Compare commits

..
Author SHA1 Message Date
hanzo-dev 733953fda9 fix(build): pin vxrn to version exposing ./worker (unbreak build:app)
The gui.hanzo.ai site (the only app shipped in the GHCR image) runs on
one@1.12.5, whose vxrn@1.12.5 self-imports vxrn/worker. kitchen-sink and
sandbox pull one@1.15.10 -> vxrn@1.15.10, which bun hoists to the root
node_modules/vxrn. vxrn@1.15.10 dropped the ./worker export, so the
hoisted copy breaks vxrn@1.12.5s self-referential import:
  Package subpath ./worker is not defined by exports in vxrn/package.json

Pin the whole one/vxrn family to 1.12.5 via root overrides so a single
vxrn (with ./worker) exists in the tree. One version, no hoist collision.
2026-06-20 02:56:44 +00:00
ed84370130 ci: containerize + arcd GHCR semver build (DOKS deploy) (#3)
Add .github/workflows/build.yml that builds+pushes ghcr.io/hanzoai/gui on
v* tags via the canonical hanzoai/.github docker-build reusable workflow
on the self-hosted arcd fleet (amd64+arm64, no GitHub-hosted runners).
Wires the existing working Dockerfile (gui.hanzo.ai, bun build, serves on
:3000) to GHCR. Semver-only tags. The npm publish-gui*.yml workflows are
unaffected.

Co-authored-by: hanzo-dev <z@hanzo.ai>
2026-06-19 16:22:49 -07:00
Antje WorringandClaude Opus 4.8 f492c1e524 docs: tidy LLM.md indexes; CLAUDE.md -> LLM.md symlink convention
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 10:04:45 -07:00
zeekay ea5357b2ad ci: route to canonical native arcd labels [self-hosted, linux, <arch>]
Replaces non-canonical scale-set / org-prefixed labels with the
existing labels every arcd host registers with. Matches evo for
amd64 and spark for arm64. No new labels added.
2026-06-10 20:15:30 -07:00
hanzo-devandClaude Opus 4.8 4b565be7af ci: targeted gui-surface publish (skip whole-workspace fan-out)
release.ts --force-publish-all crashed packing unrelated @hanzo_network/*
packages. Replace with publish-gui-surface.mjs which publishes only the
@hanzogui/* closure + hanzogui + @hanzo/gui alias, rewriting workspace:*
to concrete versions and publishing the npm pack tarball directly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:20:10 +00:00
hanzo-devandClaude Opus 4.8 143d990a69 ci: add publish-gui-all workflow to republish all gui packages with dist
Fixes broken 7.0.0 publish where @hanzogui/* primitives shipped without
dist/, breaking standalone @hanzo/gui installs. Builds then runs
release.ts --republish --force-publish-all using the same KMS->secret
NPM_TOKEN resolution as publish-gui.yml.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 19:09:27 +00:00
hanzo-devandClaude Opus 4.8 c4df0c18bc ci(publish-gui): run on spark runner (evo offline) to unblock publish
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 23:34:46 +00:00
hanzo-devandClaude Opus 4.8 84fdccaec5 perf(@hanzo/ai): optimize SDK build — skip minify/compressed-size in lib mode
CI OOM'd bundling the app-as-SDK. Skip minify (consumers minify in their own
build), skip compressed-size reporting, target esnext, and raise heap to 12GB.
Build ~89s, no OOM. (Lib output is unminified by design; downstream apps minify.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 23:04:31 +00:00
Antje WorringandClaude Opus 4.8 29102d5e9c ci: target native arcd runners (evo/spark)
Replace retired self-hosted labels with native host arcd daemons:
evo (linux/amd64), spark (linux/arm64).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 15:55:49 -07:00
hanzo-devandClaude Opus 4.8 dd357fc559 build(@hanzo/ai): raise Node heap to 8GB for the SDK vite build (CI OOM)
CI runner OOM'd bundling @hanzo/ai (exit 134). Add --max-old-space-size=8192.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 22:40:16 +00:00
hanzo-devandClaude Opus 4.8 0f8d23817e release(@hanzo/ai): 0.1.1 — brand-agnostic SDK + workspace build fixes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:58:25 +00:00
hanzo-devandClaude Opus 4.8 0ab87cf79e build: declare missing external deps across workspace packages
The monorepo relied on hoisting and never declared many externals; a clean CI
install (bun, no hoisting guarantees) failed to resolve them when bundling
@hanzo/ai. Declare them on the owning packages (net-ui +49, net-artifacts +33,
net-state, net-i18n, net-message-ts, …). @hanzogui/* workspace deps untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:36:46 +00:00
hanzo-devandClaude Opus 4.8 7c93d33c20 build(@hanzo/ai): declare missing runtime deps (immer, zod, ethers, …)
@hanzo/ai imported ~25 externals (immer, zod, ethers, framer-motion, axios,
react-hook-form, sonner, pyodide, …) not in its package.json — a clean install
(CI) failed to resolve them (local hoisting masked it). Declare them; move
test-only deps (vitest, testing-library, react-scan) to devDependencies.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:25:43 +00:00
hanzo-devandClaude Opus 4.8 8eaf705f2f build: fix workspace build (green 163/163)
- net-i18n: useChain/@hanzo_network/chain-config -> useBrand/brand-config
  (chain-config was renamed to brand-config; this import was never updated).
- loader: drop now-unused @ts-expect-error (TS2578) in GuiPlugin.ts.
Pre-existing breakage that gated the @hanzo/ai publish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 21:18:09 +00:00
hanzo-dev 794da15224 rename: claude.md → CLAUDE.md
Canonical casing per durable rule. Filesystem is case-insensitive
on macOS but git tracks the lowercase variant; uppercase is the
project convention.
2026-06-07 13:38:06 -07:00
hanzo-devandClaude Opus 4.8 5f38148a23 build: add missing per-package tsconfig.json (unblocks workspace build/publish)
10 leaf TS packages (recipes, net-brand-config, examples, *-test) lacked a
committed tsconfig.json, so the workspace build died with ENOENT on the first
one (pkgs/recipes). Add them on the standard pattern (extends root + composite).
Pre-existing breakage, gates the @hanzo/ai publish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 20:27:45 +00:00
hanzo-devandClaude Opus 4.8 84f2b23f29 refactor(brand): brand-agnostic SDK — no hardcoded brands, apps own config
- net-brand-config bundles ZERO brands: registry (registerBrands) + injection
  (setBrand/useBrand/getBrand); add company + machinesEnabled to BrandConfig.
- Brand type: drop 'hanzo'|'zoo'|'lux' union -> string (open/extensible).
- Delete hardcoded BRAND/CHAIN consts -> proxy the active brand (16 call sites
  unchanged, now read the live brand).
- isMachinesEnabled: config field, not a hardcoded brand check.
- Examples each ship their own brand.config.ts (apps do the same downstream).
- Neutral test (fixture brands, no bundled assumptions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 19:45:16 +00:00
hanzo-devandClaude Opus 4.8 40a61dc5d0 refactor(iam): brand-neutral login hook (config-driven, PKCE, per-brand)
Replace hardcoded-hanzo useHanzoLogin (hanzo.id, placeholder clientId, shipped
client secret, wrong oauth-deep-link event) with brand-neutral useIamLogin that
reads the active brand's iam config (baseUrl/clientId/redirectUri/callbackEvent)
from @hanzo_network/brand-config and uses public-client PKCE. Adding a brand is
now a config entry; nothing is hardcoded to one brand.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 18:46:40 +00:00
hanzo-devandClaude Opus 4.8 eb3ab6f07c fix(iam): real OAuth client IDs (hanzo-app/lux-app/zoo-app) for desktop login
Per-brand iam used placeholder clientIds not registered in Hanzo IAM. Domains
(hanzo.id/lux.id/zoolabs.id), redirect URIs, and callbackEvents were already
correct. Pairs with desktop redirects added to IAM init_data.json.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 18:28:36 +00:00
hanzo-devandClaude Opus 4.8 e5bb4d5db6 feat(@hanzo/ai): desktop build variant — converged frontend with full native
Add `@hanzo/ai/desktop` (vite.desktop.config.ts → dist-desktop): same converged
app as the web build, but it EXTERNALIZES @tauri-apps (14 modules) instead of
aliasing them to web shims — so a desktop consumer gets the REAL native APIs
(window/fs/dialog/updater/node-sidecar), full parity with the standalone forks.

This is the reusable foundation for converging the desktops locally: a desktop
shim is `import HanzoAI, { getBrand } from '@hanzo/ai/desktop'; <HanzoAI
{...getBrand()}/>` (VITE_BRAND selects hanzo/zoo/lux), loaded by the repo's Tauri
shell (which provides @tauri-apps + the node-manager handlers). hanzo/zoo have
full shells; lux's bespoke shell needs those handlers added.

build now emits both dist (web) + dist-desktop; exports['./desktop'] added.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 07:38:48 +00:00
hanzo-devandClaude Opus 4.8 8900f673ed fix(@hanzo/ai web): per-brand document title + favicon (was hardcoded Hanzo)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 07:15:39 +00:00
hanzo-devandClaude Opus 4.8 510c6d0dc2 build(@hanzo/ai): make publishable — drop workspace deps, public types, access
Prep for `npm publish @hanzo/ai` (the @hanzo scope):
- Drop the `@hanzo_network/* : workspace:*` runtime deps — they're bundled into
  the self-contained dist (aliased to src at build), and workspace:* can't be
  installed by consumers. Real 3rd-party deps stay.
- `publishConfig.access = public` (scoped package).
- Ship a hand-authored, self-contained public-API `dist/index.d.ts`
  (types/public.d.ts; the build copies it). Raw tsc would emit a broken tree of
  internal/@hanzo_network imports for a bundled lib.

Verified: `npm pack --dry-run` → valid tarball with dist + index.d.ts.
Note: 14 MB (bundles streamdown→shiki's ~200 grammars); a follow-up can
externalize shiki to slim it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 06:45:23 +00:00
hanzo-devandClaude Opus 4.8 94d73cedb9 ci(@hanzo/ai): run the SDK tests in CI; fix libsodium path portability
- Add `test:web` to @hanzo/ai so the existing Checks `unit-tests` job
  (`turbo run test:web`) includes the 63 SDK unit/regression tests
  (verified: `turbo run test:web --filter=@hanzo/ai` → 63 passed).
- Replace the hardcoded /home/z libsodium alias in web/vite.config.ts with a
  __dirname-relative resolve so the web build works off this machine (CI).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 06:37:52 +00:00
hanzo-devandClaude Opus 4.8 51963f855c fix(@hanzo/ai): clean the web console — host shims, CORS, auth timing, motion
Every console error/warning from the running web app, fixed and guarded by the
e2e (which now asserts the console stays clean):

- react-query "Query data cannot be undefined": web host `invoke` returns null
  (not undefined) for no-op native calls.
- "isPermissionGranted is not a function": complete the notification host shim
  (isPermissionGranted/requestPermission/sendNotification via the browser API).
- CORS on direct :36900/v1/engine/models: route the hanzo-engine client through
  a same-origin `/engine-api` vite proxy (set VITE_ENGINE_BASE_URL=/engine-api).
- "ws://localhost:1501 failed": the app derives ws port = httpPort+1; add
  local-runtime/ws-proxy.js (:1501 → node WS :3701).
- 401 /v1/node/available_models: gate useGetLLMProviders on auth — it mounted
  during onboarding and fired with an empty Bearer.
- framer-motion `motion()` deprecation → `motion.create()` (2 sites).

Tests: unit 63/63, e2e 2/2 (now also asserts no CORS / "is not a function" /
react-query-undefined / available_models / :1501 in the console). Remaining: a
rare intermittent static-asset 404 + a node-side embedding warning — neither
affects chat (documented in CHAT.md).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 06:33:23 +00:00
hanzo-devandClaude Opus 4.8 b897a3fa35 test(@hanzo/ai): vitest unit/regression + Playwright e2e + TDD setup
Establish the test harness and lock in every bug found this session as a
regression test (TDD going forward — see TESTING.md):

- vitest.config.ts: jsdom + the web build's alias graph (@/, @tauri-apps→host
  shims, @hanzo_network→src), streamdown stub, @testing-library/jest-dom setup.
  `bun run --cwd pkgs/ai test` → 61 tests green (4 new + the 7 pre-existing).
- src/__tests__/ regressions:
  • brand-store — useBrand/getBrand are plain getters callable outside render
    (the invalid-hook-call that blocked the web app)
  • host-shims — getCurrentWindow().emit etc. exist; host adapter web↔tauri
  • resizable — react-resizable-panels v3 API present + net-ui renders
  • no-missing-imports — critical screens import every <Component> they use
    (the dropped Box/Boxes/Coins lucide imports)
- e2e/chat.e2e.test.ts (vitest.e2e.config.ts): Playwright drives the real
  browser — onboarding smoke + connect→register→send→assert zen-coder reply.
  Skips cleanly when the local runtime isn't up. `test:e2e` → 2 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 05:38:57 +00:00
hanzo-devandClaude Opus 4.8 3a6ecca0bf feat(@hanzo/ai): chat works end-to-end in the browser (verified local)
The web app now chats with zen-coder-24b through a real hanzo-node, fully in the
browser (Playwright e2e: "Reply with exactly: E2E CHAT OK" → zen-coder generated
exactly that). Fixes uncovered by driving the real UI:

- main-layout.tsx: restore missing lucide imports Box/Boxes/Coins (the chat
  screens crashed with "Box is not defined").
- react-resizable-panels: the merge pulled v4 (Group/Separator), but the app
  uses the v3 API (PanelGroup/PanelResizeHandle) — pin ^3.0.2 in net-ui so the
  chat conversation view renders.
- web/vite.config.ts: proxy /v1 (the node's API is /v1/node/*, 135 endpoints) in
  addition to /v2 + /ws, so the browser reaches the node same-origin (no CORS).

local-runtime/ holds the reproducible inference wiring (see CHAT.md):
- responses-proxy.py: the node's OpenAI provider POSTs /v1/engine/responses, but
  hanzo-engine serves the Responses API at /v1/responses — rewrite the path
  (+ enable_thinking:false). This was the "AI Provider API Error" root cause.
- run-node.sh: a standalone /v1 node wired to the engine + embeddings. Uses
  127.0.0.1 everywhere (localhost → IPv6 ::1 → instant connection failure).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 05:03:49 +00:00
hanzo-devandClaude Opus 4.8 0d00a20cee Merge origin/main into @hanzo/ai SDK — land the AI app on main
Reconciles the 140 upstream commits with the @hanzo/ai SDK (pkgs/ai +
pkgs/net-*, purely additive). Only bun.lock conflicted; regenerated fresh from
the merged package.json. The markdown dep skew that this exposed is fixed by
the prior commit (shiki@^3 override + dev streamdown stub).

Verified post-merge: fresh `bun install` exit 0, turbo build passes, web prod
build (rollup, 13MB) renders the Hanzo onboarding screen, dev server renders.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 00:49:52 +00:00
hanzo-devandClaude Opus 4.8 335e911a61 fix(@hanzo/ai): harden markdown deps — clean install now renders
The committed lock had a latent skew that only surfaced on a clean `bun install`
(earlier session renders used an ephemeral node_modules):

- shiki: `@vxrn/mdx` pins shiki 1.3.0 *exact*; bun hoisted it over
  `@streamdown/code`'s `shiki@^3` (no `engine/javascript` export → build fails).
  Fix: `overrides.shiki = ^3.19.0`. Deterministic; @vxrn/mdx is docs-only, not
  in the app graph. This alone makes the PROD and LIB builds (rollup) clean —
  rollup resolves the rest of the nested micromark stack correctly.

- micromark: a v1↔v4 generation skew (16 v1 consumers from the remark/MDX docs
  stack vs 1 v2 consumer = streamdown). The two APIs (util@1 subpath exports vs
  util@2 root) must coexist nested, and rollup handles it — but esbuild's DEV
  pre-bundle flattens the bare `micromark-util-symbol` to the hoisted @1
  ("Missing '.' specifier"). Fix: a DEV-ONLY (command==='serve') stub of the
  streamdown stack (streamdown-stub.tsx); the prod build uses the real packages
  so chat markdown/code/math/mermaid are unaffected in production.

Verified clean: web dev server renders the onboarding screen, web prod build
(rollup, 13MB) renders, self-contained lib dist builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 00:46:14 +00:00
hanzo-devandClaude Opus 4.8 f138c65497 feat(@hanzo/ai): web→node proxy + chat wiring recipe
Add an env-configurable same-origin dev proxy (/v2 + /ws → VITE_NODE_API/
VITE_NODE_WS) so the browser reaches a hanzo-node without CORS: the app's
nodeAddress becomes its own origin and vite forwards to the node.

CHAT.md documents the verified state: the zen engine answers on :36900
(zen-coder-24b), and a healthy node (:2000, v1.1.20) already has the zen_engine
provider wired to it. Remaining blocker is API-version alignment — the app
client speaks /v1/node/*, the healthy node serves /v2/* only, and the
/v1-compatible desktop node (:3690) is currently hung. Recipe for both paths
included.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 00:11:54 +00:00
hanzo-devandClaude Opus 4.8 3600ce8d7b docs(@hanzo/ai): CONVERGENCE.md — one surface, web⇄desktop parity, verification matrix
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:54:57 +00:00
hanzo-devandClaude Opus 4.8 4c8c6ed1b6 feat(@hanzo/ai): self-contained dist + brand re-export → thin shims work
Make @hanzo/ai consumable as a published APP-as-SDK so each app collapses to
a ~10-line shim (the luxfi/exchange model, for AI):

- Lib build now bundles EVERYTHING (the app, net-* libs, @tauri-apps host
  shims, all 3rd-party deps) and externalizes ONLY react/react-dom as peers.
  Previously every dep was external, so a consumer installing just @hanzo/ai
  was missing libsodium/framer-motion/radix/etc. (pinned libsodium's CJS build
  in the lib config too, now that it's bundled rather than external).
- Re-export getBrand/getBrandFromHostname from the package, so a shim needs no
  separate brand package for the default case:
    import HanzoAI, { getBrand } from '@hanzo/ai'
- Shims (hanzo/zoo/lux/web) aligned to the proven pattern: brand is a build
  axis (VITE_BRAND), platform an injected prop (host={tauriHost}), app is
  @hanzo/ai. Added a runnable web shim (index.html + vite.config) that imports
  @hanzo/ai from its built dist providing only react.

Verified: the external web shim (only react/react-dom provided, everything
else from dist) renders the full Hanzo onboarding screen on :1503.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:54:10 +00:00
hanzo-devandClaude Opus 4.8 10043d3478 fix(@hanzo/ai): web app renders — break the dist self-import cycle
The web app threw `Cannot read properties of null (reading 'useContext')`
(invalid hook call) and never painted. Root cause was NOT React duplication
from a dep: 7 migrated app modules imported `useBrand` from the `@hanzo/ai`
PACKAGE name, which resolves to the built `dist/index.js`. That pulled the
whole minified library (a second React + a second copy of the app) back into
the source graph — a module cycle with a dual React dispatcher.

Fix: the injectable brand store lives in `@hanzo_network/brand-config`
(`setBrand`/`useBrand`, plain module getters — not hooks — so the app's
non-component call sites are safe), aliased to src so there is ONE copy and
no cycle. The 7 app files now import `useBrand` from there; `@hanzo/ai`'s
`brand-context` just re-exports it. Rule: app code never imports the
`@hanzo/ai` package by name.

Also completed `src/host/window.ts` to the full Tauri Window surface
(`emit`/`listen`/`once`/`onCloseRequested`/geometry) — the missing `emit`
was the next crash after the cycle was broken. Production web entry cleaned
up with a real ErrorBoundary.

Verified: dev server on :1500 paints the real Hanzo onboarding screen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:46:13 +00:00
hanzo-devandClaude Opus 4.8 d395e0c7ee feat(@hanzo/ai): decomplect the AI app into one declarative SDK
The entire shinkai-fork AI app (280 files) + its 7 @hanzo_network/* libs,
lifted into @hanzo/ai as <HanzoAI {...brand} host={}/> — brand is a prop,
platform is an injected HostAdapter (web / tauri / expo). One unified surface
for hanzo/zoo/lux desktop + mobile + web (hanzo.chat). Library build green
(2.8MB) and production web build green (14MB). Shims in examples/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 22:31:02 +00:00
842 changed files with 2175 additions and 1481577 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import React from 'react'
import type { FontSizeTokens, SelectProps } from 'hanzogui'
import { Adapt, Label, Select, Sheet, Theme, XStack, YStack, getFontSize } from 'hanzogui'
import { LinearGradient } from 'hanzogui/linear-gradient'
import { LinearGradient } from 'gui/linear-gradient'
export function SelectDemo() {
return (
+1 -1
View File
@@ -1,7 +1,7 @@
import type { GuiBuildOptions } from 'hanzogui'
export default {
components: ['hanzogui'],
components: ['gui'],
logTimings: true,
config: '@hanzogui/dev-config',
outputCSS: './gui.generated.css',
@@ -1,149 +1,10 @@
import { mkdirSync, readdirSync, statSync } from 'node:fs'
import { mkdirSync } from 'node:fs'
import { existsSync, writeFileSync, readFileSync } from 'node:fs'
import { resolve, dirname, join } from 'node:path'
import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = dirname(fileURLToPath(import.meta.url))
const RECIPES_COMPONENT_PREFIX = '@hanzogui/recipes/component/'
/**
* Recursively collect .ts/.tsx source files under a directory, skipping
* node_modules and build output.
* @param {string} dir
* @param {string[]} acc
* @returns {string[]}
*/
function collectSourceFiles(dir, acc = []) {
let entries
try {
entries = readdirSync(dir)
} catch {
return acc
}
for (const name of entries) {
if (name === 'node_modules' || name === 'dist' || name === 'recipes-output') continue
const full = join(dir, name)
let s
try {
s = statSync(full)
} catch {
continue
}
if (s.isDirectory()) {
collectSourceFiles(full, acc)
} else if (name.endsWith('.ts') || name.endsWith('.tsx')) {
acc.push(full)
}
}
return acc
}
/**
* Scan the app for deep `@hanzogui/recipes/component/*` imports and the named
* bindings each subpath must provide, so concrete stub modules can be generated
* when the (optional, pro-only) recipes repo is absent.
*
* Three import shapes are detected:
* 1. namespace -> import * as NS from '<subpath>' (then NS.Member usages)
* 2. named -> import { A, B } from '<subpath>'
* 3. re-export -> export { A } from '<subpath>'
*
* @param {string} appDir
* @returns {Record<string, string[]>} subpath -> sorted unique export names
*/
function scanRecipesSubpaths(appDir) {
const subpaths = {}
for (const file of collectSourceFiles(appDir)) {
let src
try {
src = readFileSync(file, 'utf-8')
} catch {
continue
}
if (!src.includes(RECIPES_COMPONENT_PREFIX)) continue
// namespace imports + member accesses
for (const m of src.matchAll(/import\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]/g)) {
const [, ns, sp] = m
if (!sp.startsWith(RECIPES_COMPONENT_PREFIX)) continue
subpaths[sp] ??= new Set()
const memberRe = new RegExp('\\b' + ns + '\\.([A-Za-z_][A-Za-z0-9_]*)', 'g')
for (const u of src.matchAll(memberRe)) subpaths[sp].add(u[1])
}
// named imports and re-exports
for (const m of src.matchAll(/(?:import|export)\s+\{([^}]+)\}\s+from\s+['"]([^'"]+)['"]/g)) {
const [, names, sp] = m
if (!sp.startsWith(RECIPES_COMPONENT_PREFIX)) continue
subpaths[sp] ??= new Set()
for (const raw of names.split(',')) {
const name = raw.trim().split(/\s+as\s+/)[0].trim()
if (name) subpaths[sp].add(name)
}
}
}
return Object.fromEntries(
Object.entries(subpaths).map(([k, v]) => [k, [...v].sort()])
)
}
/**
* Generate concrete stub modules for deep `@hanzogui/recipes/component/*`
* subpaths used by the showcase tree, returning a map from subpath -> absolute
* stub file path. Each stub exports a no-op component (carrying a `.fileName`
* field so `Member.fileName` reads don't throw) as the default and as every
* named binding the app imports — concrete on-disk named exports are required
* because rolldown statically validates `export { X } from` / `import { X }`
* and does not transform virtual `\0`-modules through commonjs interop.
*
* @param {Object} options
* @param {string} options.appDir - app root (dir containing components/, vite.config.ts)
* @param {string} options.outDir - directory to write stub modules into
* @returns {Record<string, string>} subpath -> absolute stub path
*/
export function generateSubpathStubs({ appDir, outDir }) {
const map = scanRecipesSubpaths(appDir)
mkdirSync(outDir, { recursive: true })
const result = {}
for (const [subpath, names] of Object.entries(map)) {
const flat = subpath.slice(RECIPES_COMPONENT_PREFIX.length).replace(/[^A-Za-z0-9]+/g, '_')
const stubPath = resolve(outDir, `${flat}.tsx`)
// Hook-shaped exports (useFoo) are called, not rendered, and their result is
// often destructured (e.g. `const { sm } = useGroupMedia(...)`), so they must
// return a (proxy) object rather than the null-rendering component stub.
const namedExports = names
.filter((n) => n !== 'default')
.map((n) =>
/^use[A-Z0-9]/.test(n)
? `export const ${n} = recipesSubpathHook`
: `export const ${n} = RecipesSubpathStub`
)
.join('\n')
writeFileSync(
stubPath,
`// AUTO-GENERATED stub for ${subpath}
// Recipes is optional (pro users only); the real components live in the
// separate recipes repo. Regenerate via scripts/generate-recipes-proxy.mjs.
function RecipesSubpathStub() {
return null
}
RecipesSubpathStub.fileName = ''
// Hook stub: returns an object that yields undefined for any destructured key,
// so callers like \`const { sm } = useGroupMedia(...)\` never throw.
const recipesSubpathHook = () =>
new Proxy({}, { get: () => undefined }) as any
export default RecipesSubpathStub
${namedExports}
`
)
result[subpath] = stubPath
}
return result
}
/**
* Generate recipes proxy files based on whether the recipes repo is available.
* Can be called from vite config or run directly as a script.
@@ -158,23 +19,11 @@ export function generateRecipesProxy(options = {}) {
const RECIPES_PATH = resolve(basePath, '../../../../recipes')
const HELPERS_DIST_PATH = resolve(basePath, '../helpers/dist')
const APP_DIR = resolve(basePath, '..')
const hasRecipes = existsSync(RECIPES_PATH)
// Ensure dist exists
mkdirSync(HELPERS_DIST_PATH, { recursive: true })
// When recipes is absent, generate concrete stub modules for every deep
// `@hanzogui/recipes/component/*` subpath the app imports, so the showcase
// tree (which is always in the build graph via RecipesComponentSection) can
// resolve its named imports/re-exports.
const subpathStubs = hasRecipes
? {}
: generateSubpathStubs({
appDir: APP_DIR,
outDir: resolve(HELPERS_DIST_PATH, 'recipes-subpath-stubs'),
})
const proxyPath = resolve(HELPERS_DIST_PATH, 'recipes-proxy.ts')
const existingContent = existsSync(proxyPath) ? readFileSync(proxyPath, 'utf-8') : ''
const isStub = existingContent.includes('Stub file for when recipes is not available')
@@ -182,7 +31,7 @@ export function generateRecipesProxy(options = {}) {
// Skip if already generated with correct state and has all exports
if (existingContent && isStub === !hasRecipes && hasCurrentRouteProvider) {
return { hasRecipes, subpathStubs }
return { hasRecipes }
}
if (!hasRecipes) {
@@ -238,7 +87,7 @@ export * as Sections from '../../components/recipes-showcase/sections'
}
}
return { hasRecipes, subpathStubs }
return { hasRecipes }
}
// Run if called directly (postinstall script)
+50 -17
View File
@@ -37,10 +37,8 @@ if (!existsSync(vitePluginDist) || !existsSync(staticDist)) {
}
}
// Generate recipes proxy files (creates stubs if recipes repo not found).
// When recipes is absent, subpathStubs maps each deep
// `@hanzogui/recipes/component/*` import to a concrete generated stub module.
const { hasRecipes, subpathStubs } = generateRecipesProxy({
// Generate recipes proxy files (creates stubs if recipes repo not found)
const { hasRecipes } = generateRecipesProxy({
basePath: pathResolve(import.meta.dirname, 'scripts'),
silent: false,
})
@@ -63,7 +61,7 @@ const include = [
'swr/mutation',
'mdx-bundler/client',
// core hanzo-gui packages must be pre-bundled together to avoid duplicate instances
'hanzogui',
'gui',
'@hanzogui/core',
'@hanzogui/web',
// existing
@@ -121,19 +119,17 @@ export default {
resolve: {
preserveSymlinks: false,
alias: [
// When recipes is absent, map each deep @hanzogui/recipes/component/*
// import to its concrete generated stub. These MUST precede the catch-all
// '@hanzogui/recipes' alias below, otherwise that alias swallows the
// subpath (resolving to recipes-proxy/component/...) and the build fails
// with UNLOADABLE_DEPENDENCY. Stubs carry the exact named exports the
// showcase tree imports/re-exports, which rolldown validates statically.
// Regex-based alias for recipes components when not available
...(!hasRecipes
? Object.entries(subpathStubs)
// longest subpath first: vite matches `id === find || id.startsWith(find + '/')`,
// so a parent like `.../user/preferences` must not shadow its child
// `.../user/preferences/LocationNotification`.
.sort(([a], [b]) => b.length - a.length)
.map(([find, replacement]) => ({ find, replacement }))
? [
{
find: /^@gui\/recipes\/component\/.+$/,
replacement: pathResolve(
import.meta.dirname,
'./helpers/dist/recipes-component-stub.tsx'
),
},
]
: []),
// Standard string-based aliases
{
@@ -208,6 +204,43 @@ export default {
},
plugins: [
// Plugin to stub recipes component imports when recipes repo is not available
!hasRecipes && {
name: 'stub-recipes-components',
enforce: 'pre', // Run before other plugins including alias resolution
resolveId(id: string) {
// Intercept imports from @hanzogui/recipes/component/*
if (id.startsWith('@hanzogui/recipes/component/')) {
// Return a virtual module ID
return '\0recipes-component-stub:' + id
}
},
load(id: string) {
// Handle the virtual module
if (id.startsWith('\0recipes-component-stub:')) {
// Return stub component code
return `
import { YStack, Paragraph } from 'hanzogui'
export default function RecipesComponentStub() {
if (process.env.NODE_ENV === 'production') {
return null
}
return (
<YStack p="$4" bc="$borderColor" br="$4">
<Paragraph size="$2" color="$color10">
Recipes component not available
</Paragraph>
</YStack>
)
}
// Export as default and named for compatibility
export const LocationNotification = RecipesComponentStub
`
}
},
},
guiPlugin({
// see gui.build.ts
disable: process.env.NODE_ENV !== 'production',
+1 -1
View File
@@ -3,7 +3,7 @@ import React from 'react'
import type { FontSizeTokens, SelectProps } from 'hanzogui'
import { Adapt, Label, Select, Sheet, XStack, YStack, getFontSize } from 'hanzogui'
import { LinearGradient } from 'hanzogui/linear-gradient'
import { LinearGradient } from 'gui/linear-gradient'
export function SelectDemo() {
return (
+356 -205
View File
File diff suppressed because it is too large Load Diff
+2 -6
View File
@@ -120,8 +120,6 @@
"devDependencies": {
"@manypkg/cli": "^0.23.0",
"@playwright/test": "^1.49.1",
"@tailwindcss/typography": "^0.5.20",
"@tailwindcss/vite": "^4",
"@testing-library/dom": "^10.4.0",
"dotenv-cli": "^7.4.2",
"esbuild": "^0.27.2",
@@ -136,7 +134,6 @@
"p-map": "^7.0.3",
"prompts": "2.1.0",
"react-native-screens": "~4.23.0",
"tailwindcss": "^4",
"turbo": "^2.1.3",
"typescript": "~5.9.2",
"ultra-runner": "^3.10.5"
@@ -144,7 +141,7 @@
"overrides": {
"@react-navigation/core": "7.9.2",
"@react-navigation/elements": "2.8.1",
"@react-navigation/native": "7.1.34",
"@react-navigation/native": "7.1.9",
"@react-navigation/native-stack": "7.6.2",
"@react-navigation/routers": "7.4.0",
"@swc/core": "1.14.0",
@@ -169,8 +166,7 @@
"@vxrn/vite-flow": "1.12.5",
"@vxrn/vite-plugin-metro": "1.12.5",
"@vxrn/tslib-lite": "1.12.5",
"create-vxrn": "1.12.5",
"@react-navigation/bottom-tabs": "7.10.1"
"create-vxrn": "1.12.5"
},
"packageManager": "bun@1.3.9",
"manypkg": {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-270
View File
@@ -1,270 +0,0 @@
'use strict';
const index = require('./index-BSSKeTjn.cjs');
function arcInnerRadius(d) {
return d.innerRadius;
}
function arcOuterRadius(d) {
return d.outerRadius;
}
function arcStartAngle(d) {
return d.startAngle;
}
function arcEndAngle(d) {
return d.endAngle;
}
function arcPadAngle(d) {
return d && d.padAngle; // Note: optional!
}
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
var x10 = x1 - x0, y10 = y1 - y0,
x32 = x3 - x2, y32 = y3 - y2,
t = y32 * x10 - x32 * y10;
if (t * t < index.epsilon) return;
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
return [x0 + t * x10, y0 + t * y10];
}
// Compute perpendicular offset line of length rc.
// http://mathworld.wolfram.com/Circle-LineIntersection.html
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
var x01 = x0 - x1,
y01 = y0 - y1,
lo = (cw ? rc : -rc) / index.sqrt(x01 * x01 + y01 * y01),
ox = lo * y01,
oy = -lo * x01,
x11 = x0 + ox,
y11 = y0 + oy,
x10 = x1 + ox,
y10 = y1 + oy,
x00 = (x11 + x10) / 2,
y00 = (y11 + y10) / 2,
dx = x10 - x11,
dy = y10 - y11,
d2 = dx * dx + dy * dy,
r = r1 - rc,
D = x11 * y10 - x10 * y11,
d = (dy < 0 ? -1 : 1) * index.sqrt(index.max(0, r * r * d2 - D * D)),
cx0 = (D * dy - dx * d) / d2,
cy0 = (-D * dx - dy * d) / d2,
cx1 = (D * dy + dx * d) / d2,
cy1 = (-D * dx + dy * d) / d2,
dx0 = cx0 - x00,
dy0 = cy0 - y00,
dx1 = cx1 - x00,
dy1 = cy1 - y00;
// Pick the closer of the two intersection points.
// TODO Is there a faster way to determine which intersection to use?
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
return {
cx: cx0,
cy: cy0,
x01: -ox,
y01: -oy,
x11: cx0 * (r1 / r - 1),
y11: cy0 * (r1 / r - 1)
};
}
function d3arc() {
var innerRadius = arcInnerRadius,
outerRadius = arcOuterRadius,
cornerRadius = index.constant(0),
padRadius = null,
startAngle = arcStartAngle,
endAngle = arcEndAngle,
padAngle = arcPadAngle,
context = null,
path = index.withPath(arc);
function arc() {
var buffer,
r,
r0 = +innerRadius.apply(this, arguments),
r1 = +outerRadius.apply(this, arguments),
a0 = startAngle.apply(this, arguments) - index.halfPi,
a1 = endAngle.apply(this, arguments) - index.halfPi,
da = index.abs(a1 - a0),
cw = a1 > a0;
if (!context) context = buffer = path();
// Ensure that the outer radius is always larger than the inner radius.
if (r1 < r0) r = r1, r1 = r0, r0 = r;
// Is it a point?
if (!(r1 > index.epsilon)) context.moveTo(0, 0);
// Or is it a circle or annulus?
else if (da > index.tau - index.epsilon) {
context.moveTo(r1 * index.cos(a0), r1 * index.sin(a0));
context.arc(0, 0, r1, a0, a1, !cw);
if (r0 > index.epsilon) {
context.moveTo(r0 * index.cos(a1), r0 * index.sin(a1));
context.arc(0, 0, r0, a1, a0, cw);
}
}
// Or is it a circular or annular sector?
else {
var a01 = a0,
a11 = a1,
a00 = a0,
a10 = a1,
da0 = da,
da1 = da,
ap = padAngle.apply(this, arguments) / 2,
rp = (ap > index.epsilon) && (padRadius ? +padRadius.apply(this, arguments) : index.sqrt(r0 * r0 + r1 * r1)),
rc = index.min(index.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
rc0 = rc,
rc1 = rc,
t0,
t1;
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
if (rp > index.epsilon) {
var p0 = index.asin(rp / r0 * index.sin(ap)),
p1 = index.asin(rp / r1 * index.sin(ap));
if ((da0 -= p0 * 2) > index.epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
if ((da1 -= p1 * 2) > index.epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
}
var x01 = r1 * index.cos(a01),
y01 = r1 * index.sin(a01),
x10 = r0 * index.cos(a10),
y10 = r0 * index.sin(a10);
// Apply rounded corners?
if (rc > index.epsilon) {
var x11 = r1 * index.cos(a11),
y11 = r1 * index.sin(a11),
x00 = r0 * index.cos(a00),
y00 = r0 * index.sin(a00),
oc;
// Restrict the corner radius according to the sector angle. If this
// intersection fails, its probably because the arc is too small, so
// disable the corner radius entirely.
if (da < index.pi) {
if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
var ax = x01 - oc[0],
ay = y01 - oc[1],
bx = x11 - oc[0],
by = y11 - oc[1],
kc = 1 / index.sin(index.acos((ax * bx + ay * by) / (index.sqrt(ax * ax + ay * ay) * index.sqrt(bx * bx + by * by))) / 2),
lc = index.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
rc0 = index.min(rc, (r0 - lc) / (kc - 1));
rc1 = index.min(rc, (r1 - lc) / (kc + 1));
} else {
rc0 = rc1 = 0;
}
}
}
// Is the sector collapsed to a line?
if (!(da1 > index.epsilon)) context.moveTo(x01, y01);
// Does the sectors outer ring have rounded corners?
else if (rc1 > index.epsilon) {
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
// Have the corners merged?
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, index.atan2(t0.y01, t0.x01), index.atan2(t1.y01, t1.x01), !cw);
// Otherwise, draw the two corners and the ring.
else {
context.arc(t0.cx, t0.cy, rc1, index.atan2(t0.y01, t0.x01), index.atan2(t0.y11, t0.x11), !cw);
context.arc(0, 0, r1, index.atan2(t0.cy + t0.y11, t0.cx + t0.x11), index.atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
context.arc(t1.cx, t1.cy, rc1, index.atan2(t1.y11, t1.x11), index.atan2(t1.y01, t1.x01), !cw);
}
}
// Or is the outer ring just a circular arc?
else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
// Is there no inner ring, and its a circular sector?
// Or perhaps its an annular sector collapsed due to padding?
if (!(r0 > index.epsilon) || !(da0 > index.epsilon)) context.lineTo(x10, y10);
// Does the sectors inner ring (or point) have rounded corners?
else if (rc0 > index.epsilon) {
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
// Have the corners merged?
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, index.atan2(t0.y01, t0.x01), index.atan2(t1.y01, t1.x01), !cw);
// Otherwise, draw the two corners and the ring.
else {
context.arc(t0.cx, t0.cy, rc0, index.atan2(t0.y01, t0.x01), index.atan2(t0.y11, t0.x11), !cw);
context.arc(0, 0, r0, index.atan2(t0.cy + t0.y11, t0.cx + t0.x11), index.atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
context.arc(t1.cx, t1.cy, rc0, index.atan2(t1.y11, t1.x11), index.atan2(t1.y01, t1.x01), !cw);
}
}
// Or is the inner ring just a circular arc?
else context.arc(0, 0, r0, a10, a00, cw);
}
context.closePath();
if (buffer) return context = null, buffer + "" || null;
}
arc.centroid = function() {
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - index.pi / 2;
return [index.cos(a) * r, index.sin(a) * r];
};
arc.innerRadius = function(_) {
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : innerRadius;
};
arc.outerRadius = function(_) {
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : outerRadius;
};
arc.cornerRadius = function(_) {
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : cornerRadius;
};
arc.padRadius = function(_) {
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : index.constant(+_), arc) : padRadius;
};
arc.startAngle = function(_) {
return arguments.length ? (startAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : startAngle;
};
arc.endAngle = function(_) {
return arguments.length ? (endAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : endAngle;
};
arc.padAngle = function(_) {
return arguments.length ? (padAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : padAngle;
};
arc.context = function(_) {
return arguments.length ? ((context = _ == null ? null : _), arc) : context;
};
return arc;
}
exports.d3arc = d3arc;
-268
View File
@@ -1,268 +0,0 @@
import { P as withPath, Q as pi, S as cos, T as sin, V as constant, W as halfPi, X as epsilon, Y as tau, Z as sqrt, $ as min, a0 as abs, a1 as atan2, a2 as max, a3 as asin, a4 as acos } from './index-BnaE_tRw.js';
function arcInnerRadius(d) {
return d.innerRadius;
}
function arcOuterRadius(d) {
return d.outerRadius;
}
function arcStartAngle(d) {
return d.startAngle;
}
function arcEndAngle(d) {
return d.endAngle;
}
function arcPadAngle(d) {
return d && d.padAngle; // Note: optional!
}
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
var x10 = x1 - x0, y10 = y1 - y0,
x32 = x3 - x2, y32 = y3 - y2,
t = y32 * x10 - x32 * y10;
if (t * t < epsilon) return;
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
return [x0 + t * x10, y0 + t * y10];
}
// Compute perpendicular offset line of length rc.
// http://mathworld.wolfram.com/Circle-LineIntersection.html
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
var x01 = x0 - x1,
y01 = y0 - y1,
lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),
ox = lo * y01,
oy = -lo * x01,
x11 = x0 + ox,
y11 = y0 + oy,
x10 = x1 + ox,
y10 = y1 + oy,
x00 = (x11 + x10) / 2,
y00 = (y11 + y10) / 2,
dx = x10 - x11,
dy = y10 - y11,
d2 = dx * dx + dy * dy,
r = r1 - rc,
D = x11 * y10 - x10 * y11,
d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),
cx0 = (D * dy - dx * d) / d2,
cy0 = (-D * dx - dy * d) / d2,
cx1 = (D * dy + dx * d) / d2,
cy1 = (-D * dx + dy * d) / d2,
dx0 = cx0 - x00,
dy0 = cy0 - y00,
dx1 = cx1 - x00,
dy1 = cy1 - y00;
// Pick the closer of the two intersection points.
// TODO Is there a faster way to determine which intersection to use?
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
return {
cx: cx0,
cy: cy0,
x01: -ox,
y01: -oy,
x11: cx0 * (r1 / r - 1),
y11: cy0 * (r1 / r - 1)
};
}
function d3arc() {
var innerRadius = arcInnerRadius,
outerRadius = arcOuterRadius,
cornerRadius = constant(0),
padRadius = null,
startAngle = arcStartAngle,
endAngle = arcEndAngle,
padAngle = arcPadAngle,
context = null,
path = withPath(arc);
function arc() {
var buffer,
r,
r0 = +innerRadius.apply(this, arguments),
r1 = +outerRadius.apply(this, arguments),
a0 = startAngle.apply(this, arguments) - halfPi,
a1 = endAngle.apply(this, arguments) - halfPi,
da = abs(a1 - a0),
cw = a1 > a0;
if (!context) context = buffer = path();
// Ensure that the outer radius is always larger than the inner radius.
if (r1 < r0) r = r1, r1 = r0, r0 = r;
// Is it a point?
if (!(r1 > epsilon)) context.moveTo(0, 0);
// Or is it a circle or annulus?
else if (da > tau - epsilon) {
context.moveTo(r1 * cos(a0), r1 * sin(a0));
context.arc(0, 0, r1, a0, a1, !cw);
if (r0 > epsilon) {
context.moveTo(r0 * cos(a1), r0 * sin(a1));
context.arc(0, 0, r0, a1, a0, cw);
}
}
// Or is it a circular or annular sector?
else {
var a01 = a0,
a11 = a1,
a00 = a0,
a10 = a1,
da0 = da,
da1 = da,
ap = padAngle.apply(this, arguments) / 2,
rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),
rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
rc0 = rc,
rc1 = rc,
t0,
t1;
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
if (rp > epsilon) {
var p0 = asin(rp / r0 * sin(ap)),
p1 = asin(rp / r1 * sin(ap));
if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
}
var x01 = r1 * cos(a01),
y01 = r1 * sin(a01),
x10 = r0 * cos(a10),
y10 = r0 * sin(a10);
// Apply rounded corners?
if (rc > epsilon) {
var x11 = r1 * cos(a11),
y11 = r1 * sin(a11),
x00 = r0 * cos(a00),
y00 = r0 * sin(a00),
oc;
// Restrict the corner radius according to the sector angle. If this
// intersection fails, its probably because the arc is too small, so
// disable the corner radius entirely.
if (da < pi) {
if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
var ax = x01 - oc[0],
ay = y01 - oc[1],
bx = x11 - oc[0],
by = y11 - oc[1],
kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),
lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
rc0 = min(rc, (r0 - lc) / (kc - 1));
rc1 = min(rc, (r1 - lc) / (kc + 1));
} else {
rc0 = rc1 = 0;
}
}
}
// Is the sector collapsed to a line?
if (!(da1 > epsilon)) context.moveTo(x01, y01);
// Does the sectors outer ring have rounded corners?
else if (rc1 > epsilon) {
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
// Have the corners merged?
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
// Otherwise, draw the two corners and the ring.
else {
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
}
}
// Or is the outer ring just a circular arc?
else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
// Is there no inner ring, and its a circular sector?
// Or perhaps its an annular sector collapsed due to padding?
if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);
// Does the sectors inner ring (or point) have rounded corners?
else if (rc0 > epsilon) {
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
// Have the corners merged?
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
// Otherwise, draw the two corners and the ring.
else {
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
}
}
// Or is the inner ring just a circular arc?
else context.arc(0, 0, r0, a10, a00, cw);
}
context.closePath();
if (buffer) return context = null, buffer + "" || null;
}
arc.centroid = function() {
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
return [cos(a) * r, sin(a) * r];
};
arc.innerRadius = function(_) {
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
};
arc.outerRadius = function(_) {
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
};
arc.cornerRadius = function(_) {
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
};
arc.padRadius = function(_) {
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
};
arc.startAngle = function(_) {
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
};
arc.endAngle = function(_) {
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
};
arc.padAngle = function(_) {
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
};
arc.context = function(_) {
return arguments.length ? ((context = _ == null ? null : _), arc) : context;
};
return arc;
}
export { d3arc as d };
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,3 +0,0 @@
var __viteBrowserExternal = {};
export { __viteBrowserExternal as default };
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
const lang = Object.freeze(JSON.parse("{\"displayName\":\"Berry\",\"name\":\"berry\",\"patterns\":[{\"include\":\"#controls\"},{\"include\":\"#strings\"},{\"include\":\"#comment-block\"},{\"include\":\"#comments\"},{\"include\":\"#keywords\"},{\"include\":\"#function\"},{\"include\":\"#member\"},{\"include\":\"#identifier\"},{\"include\":\"#number\"},{\"include\":\"#operator\"}],\"repository\":{\"comment-block\":{\"begin\":\"#-\",\"end\":\"-#\",\"name\":\"comment.berry\",\"patterns\":[{}]},\"comments\":{\"begin\":\"#\",\"end\":\"\\\\n\",\"name\":\"comment.line.berry\",\"patterns\":[{}]},\"controls\":{\"patterns\":[{\"match\":\"\\\\b(if|elif|else|for|while|do|end|break|continue|return|try|except|raise)\\\\b\",\"name\":\"keyword.control.berry\"}]},\"function\":{\"patterns\":[{\"match\":\"\\\\b([A-Z_a-z][0-9A-Z_a-z]*(?=\\\\s*\\\\())\",\"name\":\"entity.name.function.berry\"}]},\"identifier\":{\"patterns\":[{\"match\":\"\\\\b[A-Z_a-z]\\\\w+\\\\b\",\"name\":\"identifier.berry\"}]},\"keywords\":{\"patterns\":[{\"match\":\"\\\\b(var|static|def|class|true|false|nil|self|super|import|as|_class)\\\\b\",\"name\":\"keyword.berry\"}]},\"member\":{\"patterns\":[{\"captures\":{\"0\":{\"name\":\"entity.other.attribute-name.berry\"}},\"match\":\"\\\\.([A-Z_a-z][0-9A-Z_a-z]*)\"}]},\"number\":{\"patterns\":[{\"match\":\"0x\\\\h+|\\\\d+|(\\\\d+\\\\.?|\\\\.\\\\d)\\\\d*([Ee][-+]?\\\\d+)?\",\"name\":\"constant.numeric.berry\"}]},\"operator\":{\"patterns\":[{\"match\":\"[-\\\\]!%\\\\&(-+./:<=>\\\\[^|~]\",\"name\":\"keyword.operator.berry\"}]},\"strings\":{\"patterns\":[{\"begin\":\"f(?=[\\\"'])\",\"patterns\":[{\"begin\":\"\\\"\",\"end\":\"\\\"\",\"name\":\"string.quoted.other.berry\",\"patterns\":[{\"match\":\"(\\\\\\\\x\\\\h{2})|(\\\\\\\\[0-7]{3})|(\\\\\\\\\\\\\\\\)|(\\\\\\\\\\\")|(\\\\\\\\')|(\\\\\\\\a)|(\\\\\\\\b)|(\\\\\\\\f)|(\\\\\\\\n)|(\\\\\\\\r)|(\\\\\\\\t)|(\\\\\\\\v)\",\"name\":\"constant.character.escape.berry\"},{\"match\":\"\\\\{\\\\{[^}]*}}\",\"name\":\"string.quoted.other.berry\"},{\"begin\":\"\\\\{\",\"end\":\"}\",\"name\":\"keyword.other.unit.berry\",\"patterns\":[{\"include\":\"#keywords\"},{\"include\":\"#numbers\"},{\"include\":\"#identifier\"},{\"include\":\"#operator\"},{\"include\":\"#member\"},{\"include\":\"#function\"}]}]},{\"begin\":\"'\",\"end\":\"'\",\"name\":\"string.quoted.other.berry\",\"patterns\":[{\"match\":\"(\\\\\\\\x\\\\h{2})|(\\\\\\\\[0-7]{3})|(\\\\\\\\\\\\\\\\)|(\\\\\\\\\\\")|(\\\\\\\\')|(\\\\\\\\a)|(\\\\\\\\b)|(\\\\\\\\f)|(\\\\\\\\n)|(\\\\\\\\r)|(\\\\\\\\t)|(\\\\\\\\v)\",\"name\":\"constant.character.escape.berry\"},{\"match\":\"\\\\{\\\\{[^}]*}}\",\"name\":\"string.quoted.other.berry\"},{\"begin\":\"\\\\{\",\"end\":\"}\",\"name\":\"keyword.other.unit.berry\",\"patterns\":[{\"include\":\"#keywords\"},{\"include\":\"#numbers\"},{\"include\":\"#identifier\"},{\"include\":\"#operator\"},{\"include\":\"#member\"},{\"include\":\"#function\"}]}]}],\"while\":\"\\\\G|^[\\\\t ]*(?=[\\\"'])\"},{\"begin\":\"([\\\"'])\",\"end\":\"\\\\1\",\"name\":\"string.quoted.double.berry\",\"patterns\":[{\"match\":\"(\\\\\\\\x\\\\h{2})|(\\\\\\\\[0-7]{3})|(\\\\\\\\\\\\\\\\)|(\\\\\\\\\\\")|(\\\\\\\\')|(\\\\\\\\a)|(\\\\\\\\b)|(\\\\\\\\f)|(\\\\\\\\n)|(\\\\\\\\r)|(\\\\\\\\t)|(\\\\\\\\v)\",\"name\":\"constant.character.escape.berry\"}]}]}},\"scopeName\":\"source.berry\",\"aliases\":[\"be\"]}"));
const berry = [
lang
];
export { berry as default };
-11
View File
@@ -1,11 +0,0 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const lang = Object.freeze(JSON.parse("{\"displayName\":\"Berry\",\"name\":\"berry\",\"patterns\":[{\"include\":\"#controls\"},{\"include\":\"#strings\"},{\"include\":\"#comment-block\"},{\"include\":\"#comments\"},{\"include\":\"#keywords\"},{\"include\":\"#function\"},{\"include\":\"#member\"},{\"include\":\"#identifier\"},{\"include\":\"#number\"},{\"include\":\"#operator\"}],\"repository\":{\"comment-block\":{\"begin\":\"#-\",\"end\":\"-#\",\"name\":\"comment.berry\",\"patterns\":[{}]},\"comments\":{\"begin\":\"#\",\"end\":\"\\\\n\",\"name\":\"comment.line.berry\",\"patterns\":[{}]},\"controls\":{\"patterns\":[{\"match\":\"\\\\b(if|elif|else|for|while|do|end|break|continue|return|try|except|raise)\\\\b\",\"name\":\"keyword.control.berry\"}]},\"function\":{\"patterns\":[{\"match\":\"\\\\b([A-Z_a-z][0-9A-Z_a-z]*(?=\\\\s*\\\\())\",\"name\":\"entity.name.function.berry\"}]},\"identifier\":{\"patterns\":[{\"match\":\"\\\\b[A-Z_a-z]\\\\w+\\\\b\",\"name\":\"identifier.berry\"}]},\"keywords\":{\"patterns\":[{\"match\":\"\\\\b(var|static|def|class|true|false|nil|self|super|import|as|_class)\\\\b\",\"name\":\"keyword.berry\"}]},\"member\":{\"patterns\":[{\"captures\":{\"0\":{\"name\":\"entity.other.attribute-name.berry\"}},\"match\":\"\\\\.([A-Z_a-z][0-9A-Z_a-z]*)\"}]},\"number\":{\"patterns\":[{\"match\":\"0x\\\\h+|\\\\d+|(\\\\d+\\\\.?|\\\\.\\\\d)\\\\d*([Ee][-+]?\\\\d+)?\",\"name\":\"constant.numeric.berry\"}]},\"operator\":{\"patterns\":[{\"match\":\"[-\\\\]!%\\\\&(-+./:<=>\\\\[^|~]\",\"name\":\"keyword.operator.berry\"}]},\"strings\":{\"patterns\":[{\"begin\":\"f(?=[\\\"'])\",\"patterns\":[{\"begin\":\"\\\"\",\"end\":\"\\\"\",\"name\":\"string.quoted.other.berry\",\"patterns\":[{\"match\":\"(\\\\\\\\x\\\\h{2})|(\\\\\\\\[0-7]{3})|(\\\\\\\\\\\\\\\\)|(\\\\\\\\\\\")|(\\\\\\\\')|(\\\\\\\\a)|(\\\\\\\\b)|(\\\\\\\\f)|(\\\\\\\\n)|(\\\\\\\\r)|(\\\\\\\\t)|(\\\\\\\\v)\",\"name\":\"constant.character.escape.berry\"},{\"match\":\"\\\\{\\\\{[^}]*}}\",\"name\":\"string.quoted.other.berry\"},{\"begin\":\"\\\\{\",\"end\":\"}\",\"name\":\"keyword.other.unit.berry\",\"patterns\":[{\"include\":\"#keywords\"},{\"include\":\"#numbers\"},{\"include\":\"#identifier\"},{\"include\":\"#operator\"},{\"include\":\"#member\"},{\"include\":\"#function\"}]}]},{\"begin\":\"'\",\"end\":\"'\",\"name\":\"string.quoted.other.berry\",\"patterns\":[{\"match\":\"(\\\\\\\\x\\\\h{2})|(\\\\\\\\[0-7]{3})|(\\\\\\\\\\\\\\\\)|(\\\\\\\\\\\")|(\\\\\\\\')|(\\\\\\\\a)|(\\\\\\\\b)|(\\\\\\\\f)|(\\\\\\\\n)|(\\\\\\\\r)|(\\\\\\\\t)|(\\\\\\\\v)\",\"name\":\"constant.character.escape.berry\"},{\"match\":\"\\\\{\\\\{[^}]*}}\",\"name\":\"string.quoted.other.berry\"},{\"begin\":\"\\\\{\",\"end\":\"}\",\"name\":\"keyword.other.unit.berry\",\"patterns\":[{\"include\":\"#keywords\"},{\"include\":\"#numbers\"},{\"include\":\"#identifier\"},{\"include\":\"#operator\"},{\"include\":\"#member\"},{\"include\":\"#function\"}]}]}],\"while\":\"\\\\G|^[\\\\t ]*(?=[\\\"'])\"},{\"begin\":\"([\\\"'])\",\"end\":\"\\\\1\",\"name\":\"string.quoted.double.berry\",\"patterns\":[{\"match\":\"(\\\\\\\\x\\\\h{2})|(\\\\\\\\[0-7]{3})|(\\\\\\\\\\\\\\\\)|(\\\\\\\\\\\")|(\\\\\\\\')|(\\\\\\\\a)|(\\\\\\\\b)|(\\\\\\\\f)|(\\\\\\\\n)|(\\\\\\\\r)|(\\\\\\\\t)|(\\\\\\\\v)\",\"name\":\"constant.character.escape.berry\"}]}]}},\"scopeName\":\"source.berry\",\"aliases\":[\"be\"]}"));
const berry = [
lang
];
exports.default = berry;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-14
View File
@@ -1,14 +0,0 @@
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const python = require('./python-R5Doq6Ap.cjs');
const lang = Object.freeze(JSON.parse("{\"displayName\":\"Cairo\",\"name\":\"cairo\",\"patterns\":[{\"begin\":\"\\\\b(if).*\\\\(\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.if\"},\"2\":{\"name\":\"entity.name.condition\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"keyword.control.end\"}},\"name\":\"meta.control.if\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"begin\":\"\\\\b(with)\\\\s+(.+)\\\\s*\\\\{\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.with\"},\"2\":{\"name\":\"entity.name.identifiers\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"keyword.control.end\"}},\"name\":\"meta.control.with\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"begin\":\"\\\\b(with_attr)\\\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*[({]\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.with_attr\"},\"2\":{\"name\":\"entity.name.function\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"keyword.control.end\"}},\"name\":\"meta.control.with_attr\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"match\":\"\\\\belse\\\\b\",\"name\":\"keyword.control.else\"},{\"match\":\"\\\\b(call|jmp|ret|abs|rel|if)\\\\b\",\"name\":\"keyword.other.opcode\"},{\"match\":\"\\\\b([af]p)\\\\b\",\"name\":\"keyword.other.register\"},{\"match\":\"\\\\b(const|let|local|tempvar|felt|as|from|import|static_assert|return|assert|cast|alloc_locals|with|with_attr|nondet|dw|codeoffset|new|using|and)\\\\b\",\"name\":\"keyword.other.meta\"},{\"match\":\"\\\\b(SIZE(?:OF_LOCALS|))\\\\b\",\"name\":\"markup.italic\"},{\"match\":\"//[^\\\\n]*\\\\n\",\"name\":\"comment.line.sharp\"},{\"match\":\"\\\\b[A-Z_a-z][0-9A-Z_a-z]*:\\\\s*$\",\"name\":\"entity.name.function\"},{\"begin\":\"\\\\b(func)\\\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*[({]\",\"beginCaptures\":{\"1\":{\"name\":\"storage.type.function.cairo\"},\"2\":{\"name\":\"entity.name.function\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"storage.type.function.cairo\"}},\"name\":\"meta.function.cairo\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"begin\":\"\\\\b(struct|namespace)\\\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*\\\\{\",\"beginCaptures\":{\"1\":{\"name\":\"storage.type.function.cairo\"},\"2\":{\"name\":\"entity.name.function\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"storage.type.function.cairo\"}},\"name\":\"meta.function.cairo\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"match\":\"\\\\b[-+]?[0-9]+\\\\b\",\"name\":\"constant.numeric.decimal\"},{\"match\":\"\\\\b[-+]?0x\\\\h+\\\\b\",\"name\":\"constant.numeric.hexadecimal\"},{\"match\":\"'[^']*'\",\"name\":\"string.quoted.single\"},{\"match\":\"\\\"[^\\\"]*\\\"\",\"name\":\"string.quoted.double\"},{\"begin\":\"%\\\\{\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.section.embedded.begin.python\"}},\"contentName\":\"source.python\",\"end\":\"%}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.section.embedded.end.python\"},\"1\":{\"name\":\"source.python\"}},\"name\":\"meta.embedded.block.python\",\"patterns\":[{\"include\":\"source.python\"}]}],\"scopeName\":\"source.cairo0\",\"embeddedLangs\":[\"python\"]}"));
const cairo = [
...python.default,
lang
];
exports.default = cairo;
-10
View File
@@ -1,10 +0,0 @@
import python from './python-CRy0opiU.js';
const lang = Object.freeze(JSON.parse("{\"displayName\":\"Cairo\",\"name\":\"cairo\",\"patterns\":[{\"begin\":\"\\\\b(if).*\\\\(\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.if\"},\"2\":{\"name\":\"entity.name.condition\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"keyword.control.end\"}},\"name\":\"meta.control.if\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"begin\":\"\\\\b(with)\\\\s+(.+)\\\\s*\\\\{\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.with\"},\"2\":{\"name\":\"entity.name.identifiers\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"keyword.control.end\"}},\"name\":\"meta.control.with\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"begin\":\"\\\\b(with_attr)\\\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*[({]\",\"beginCaptures\":{\"1\":{\"name\":\"keyword.control.with_attr\"},\"2\":{\"name\":\"entity.name.function\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"keyword.control.end\"}},\"name\":\"meta.control.with_attr\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"match\":\"\\\\belse\\\\b\",\"name\":\"keyword.control.else\"},{\"match\":\"\\\\b(call|jmp|ret|abs|rel|if)\\\\b\",\"name\":\"keyword.other.opcode\"},{\"match\":\"\\\\b([af]p)\\\\b\",\"name\":\"keyword.other.register\"},{\"match\":\"\\\\b(const|let|local|tempvar|felt|as|from|import|static_assert|return|assert|cast|alloc_locals|with|with_attr|nondet|dw|codeoffset|new|using|and)\\\\b\",\"name\":\"keyword.other.meta\"},{\"match\":\"\\\\b(SIZE(?:OF_LOCALS|))\\\\b\",\"name\":\"markup.italic\"},{\"match\":\"//[^\\\\n]*\\\\n\",\"name\":\"comment.line.sharp\"},{\"match\":\"\\\\b[A-Z_a-z][0-9A-Z_a-z]*:\\\\s*$\",\"name\":\"entity.name.function\"},{\"begin\":\"\\\\b(func)\\\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*[({]\",\"beginCaptures\":{\"1\":{\"name\":\"storage.type.function.cairo\"},\"2\":{\"name\":\"entity.name.function\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"storage.type.function.cairo\"}},\"name\":\"meta.function.cairo\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"begin\":\"\\\\b(struct|namespace)\\\\s+([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*\\\\{\",\"beginCaptures\":{\"1\":{\"name\":\"storage.type.function.cairo\"},\"2\":{\"name\":\"entity.name.function\"}},\"contentName\":\"source.cairo0\",\"end\":\"}\",\"endCaptures\":{\"0\":{\"name\":\"storage.type.function.cairo\"}},\"name\":\"meta.function.cairo\",\"patterns\":[{\"include\":\"source.cairo0\"}]},{\"match\":\"\\\\b[-+]?[0-9]+\\\\b\",\"name\":\"constant.numeric.decimal\"},{\"match\":\"\\\\b[-+]?0x\\\\h+\\\\b\",\"name\":\"constant.numeric.hexadecimal\"},{\"match\":\"'[^']*'\",\"name\":\"string.quoted.single\"},{\"match\":\"\\\"[^\\\"]*\\\"\",\"name\":\"string.quoted.double\"},{\"begin\":\"%\\\\{\",\"beginCaptures\":{\"0\":{\"name\":\"punctuation.section.embedded.begin.python\"}},\"contentName\":\"source.python\",\"end\":\"%}\",\"endCaptures\":{\"0\":{\"name\":\"punctuation.section.embedded.end.python\"},\"1\":{\"name\":\"source.python\"}},\"name\":\"meta.embedded.block.python\",\"patterns\":[{\"include\":\"source.python\"}]}],\"scopeName\":\"source.cairo0\",\"embeddedLangs\":[\"python\"]}"));
const cairo = [
...python,
lang
];
export { cairo as default };
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-9
View File
@@ -1,9 +0,0 @@
import { U as Utils, F as Color } from './index-BnaE_tRw.js';
/* IMPORT */
/* MAIN */
const channel = (color, channel) => {
return Utils.lang.round(Color.parse(color)[channel]);
};
export { channel as c };
-11
View File
@@ -1,11 +0,0 @@
'use strict';
const index = require('./index-BSSKeTjn.cjs');
/* IMPORT */
/* MAIN */
const channel = (color, channel) => {
return index.Utils.lang.round(index.Color.parse(color)[channel]);
};
exports.channel = channel;
@@ -1,25 +0,0 @@
import { _ as __name, e as configureSvgSize, l as log } from './index-BnaE_tRw.js';
// src/rendering-util/setupViewPortForSVG.ts
var setupViewPortForSVG = /* @__PURE__ */ __name((svg, padding, cssDiagram, useMaxWidth) => {
svg.attr("class", cssDiagram);
const { width, height, x, y } = calculateDimensionsWithPadding(svg, padding);
configureSvgSize(svg, height, width, useMaxWidth);
const viewBox = createViewBox(x, y, width, height, padding);
svg.attr("viewBox", viewBox);
log.debug(`viewBox configured: ${viewBox} with padding: ${padding}`);
}, "setupViewPortForSVG");
var calculateDimensionsWithPadding = /* @__PURE__ */ __name((svg, padding) => {
const bounds = svg.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 };
return {
width: bounds.width + padding * 2,
height: bounds.height + padding * 2,
x: bounds.x,
y: bounds.y
};
}, "calculateDimensionsWithPadding");
var createViewBox = /* @__PURE__ */ __name((x, y, width, height, padding) => {
return `${x - padding} ${y - padding} ${width} ${height}`;
}, "createViewBox");
export { setupViewPortForSVG as s };
@@ -1,27 +0,0 @@
'use strict';
const index = require('./index-BSSKeTjn.cjs');
// src/rendering-util/setupViewPortForSVG.ts
var setupViewPortForSVG = /* @__PURE__ */ index.__name((svg, padding, cssDiagram, useMaxWidth) => {
svg.attr("class", cssDiagram);
const { width, height, x, y } = calculateDimensionsWithPadding(svg, padding);
index.configureSvgSize(svg, height, width, useMaxWidth);
const viewBox = createViewBox(x, y, width, height, padding);
svg.attr("viewBox", viewBox);
index.log.debug(`viewBox configured: ${viewBox} with padding: ${padding}`);
}, "setupViewPortForSVG");
var calculateDimensionsWithPadding = /* @__PURE__ */ index.__name((svg, padding) => {
const bounds = svg.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 };
return {
width: bounds.width + padding * 2,
height: bounds.height + padding * 2,
x: bounds.x,
y: bounds.y
};
}, "calculateDimensionsWithPadding");
var createViewBox = /* @__PURE__ */ index.__name((x, y, width, height, padding) => {
return `${x - padding} ${y - padding} ${width} ${height}`;
}, "createViewBox");
exports.setupViewPortForSVG = setupViewPortForSVG;
@@ -1,17 +0,0 @@
import { _ as __name } from './index-BnaE_tRw.js';
// src/diagrams/common/populateCommonDb.ts
function populateCommonDb(ast, db) {
if (ast.accDescr) {
db.setAccDescription?.(ast.accDescr);
}
if (ast.accTitle) {
db.setAccTitle?.(ast.accTitle);
}
if (ast.title) {
db.setDiagramTitle?.(ast.title);
}
}
__name(populateCommonDb, "populateCommonDb");
export { populateCommonDb as p };
@@ -1,19 +0,0 @@
'use strict';
const index = require('./index-BSSKeTjn.cjs');
// src/diagrams/common/populateCommonDb.ts
function populateCommonDb(ast, db) {
if (ast.accDescr) {
db.setAccDescription?.(ast.accDescr);
}
if (ast.accTitle) {
db.setAccTitle?.(ast.accTitle);
}
if (ast.title) {
db.setDiagramTitle?.(ast.title);
}
}
index.__name(populateCommonDb, "populateCommonDb");
exports.populateCommonDb = populateCommonDb;
@@ -1,15 +0,0 @@
'use strict';
const index = require('./index-BSSKeTjn.cjs');
var getDiagramElement = /* @__PURE__ */ index.__name((id, securityLevel) => {
let sandboxElement;
if (securityLevel === "sandbox") {
sandboxElement = index.select("#i" + id);
}
const root = securityLevel === "sandbox" ? index.select(sandboxElement.nodes()[0].contentDocument.body) : index.select("body");
const svg = root.select(`[id="${id}"]`);
return svg;
}, "getDiagramElement");
exports.getDiagramElement = getDiagramElement;
@@ -1,13 +0,0 @@
import { _ as __name, d as select } from './index-BnaE_tRw.js';
var getDiagramElement = /* @__PURE__ */ __name((id, securityLevel) => {
let sandboxElement;
if (securityLevel === "sandbox") {
sandboxElement = select("#i" + id);
}
const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
const svg = root.select(`[id="${id}"]`);
return svg;
}, "getDiagramElement");
export { getDiagramElement as g };
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More