init
This commit is contained in:
commit
2271ec8ebd
571 changed files with 376968 additions and 0 deletions
4
.turbo/turbo-check-types.log
Normal file
4
.turbo/turbo-check-types.log
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
> @blinksgg/canvas@0.1.0 check-types /home/amir/code/blinksgg/gg-antifragile/packages/canvas
|
||||
> tsc --noEmit
|
||||
|
||||
947
CHANGELOG.md
Normal file
947
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,947 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to `@blinksgg/canvas` will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [3.0.0] - 2026-03-11 — "React Compiler"
|
||||
|
||||
### BREAKING
|
||||
- Peer dependencies now require `react` / `react-dom` **^19.2.0** (was ^19.0.0)
|
||||
- Removed all manual `useCallback` / `useMemo` wrappers — React Compiler auto-optimizes
|
||||
|
||||
### Changed
|
||||
- Integrated **React Compiler** (`babel-plugin-react-compiler`) into Vitest pipeline
|
||||
- Added `@vitejs/plugin-react` for Babel transform support
|
||||
- Removed `useCallback` from `useGestureSystem.ts` (4), `GestureProvider.tsx` (1), `useGestureResolver.ts` (1)
|
||||
- Removed `useMemo` from `useGestureSystem.ts` (1), `GestureProvider.tsx` (1), `keyboard.ts` (1)
|
||||
- Replaced `useMemo(() => nextOwnerId++, [])` with `useState(() => nextOwnerId++)` in `GestureProvider.tsx`
|
||||
|
||||
### Tests
|
||||
- All 761 passing tests remain green — zero regressions
|
||||
|
||||
## [2.5.0] - 2026-03-11 — "Hook Integration"
|
||||
|
||||
### Changed
|
||||
- Exported `easeInOutCubic` from `useAnimatedLayout.ts` for independent testing
|
||||
|
||||
### Added
|
||||
- **`animated-layout.test.ts`** — 9 tests: easeInOutCubic boundary values, monotonicity, range
|
||||
- **`useActionExecutor-hook.test.ts`** — 6 tests: renderHook integration, return shape
|
||||
- **`usePlugin-hook.test.ts`** — 5 tests: register/unregister lifecycle, re-render stability
|
||||
- **`useLayout-hook.test.ts`** — 4 tests: useLayout, useGetGraphBounds, useFitToBounds
|
||||
|
||||
### Tests
|
||||
- 24 new tests across 4 new test files (first React hook integration tests)
|
||||
- Total passing: 473 across 54 test files
|
||||
|
||||
## [2.4.0] - 2026-03-11 — "Deep Logic"
|
||||
|
||||
### Added
|
||||
- **`drag-state-machine.test.ts`** — 11 tests: buildDragPositions, computeDragUpdates, isDragPrevented
|
||||
- **`action-types-enums.test.ts`** — 9 tests: ActionCategory enum, BuiltInActionId uniqueness
|
||||
- **`event-types-enums.test.ts`** — 10 tests: CanvasEventType, EVENT_TYPE_INFO completeness
|
||||
- **`gesture-rules-types.test.ts`** — 6 tests: GestureDescriptor/Pattern/Rule shapes
|
||||
|
||||
### Tests
|
||||
- 36 new tests across 4 new test files
|
||||
- Total passing: 449 across 50 test files
|
||||
|
||||
## [2.3.0] - 2026-03-11 — "Edge Coverage"
|
||||
|
||||
### Added
|
||||
- **`actions-node.test.ts`** — 8 tests: selection + node action registration verification
|
||||
- **`actions-viewport.test.ts`** — 6 tests: viewport + history action registration
|
||||
- **`modifier-helpers.test.ts`** — 9 tests: isRepeatBlocked, getSelectedNodeIds, resolveFocusableNodeId, getCurrentSubject
|
||||
- **`pointer-bindings-v2.test.ts`** — 6 tests: array integrity, unique IDs, pattern types
|
||||
- **`plugin-types.test.ts`** — 5 tests: PluginError construction, CanvasPlugin interface shape
|
||||
|
||||
### Tests
|
||||
- 34 new tests across 5 new test files
|
||||
- Total passing: 413 across 46 test files
|
||||
|
||||
## [2.2.0] - 2026-03-11 — "Total Coverage"
|
||||
|
||||
### Changed
|
||||
- Split `built-in-actions.ts` (342L) into `actions-node.ts` and `actions-viewport.ts`; original slimmed to 44L barrel
|
||||
|
||||
### Added
|
||||
- **`keyboard-bindings.test.ts`** — 6 tests: array integrity, unique IDs, standard shortcuts
|
||||
- **`gesture-classification.test.ts`** — 3 tests: findNearestNode contract, empty graph
|
||||
- **`viewport-commands.test.ts`** — 7 tests: command shapes, registration, descriptions
|
||||
- **`serialization-commands.test.ts`** — 5 tests: export/import shapes, registration
|
||||
- **`store-atoms.test.ts`** — 13 tests: default values, isCommandActive, currentInput, commandProgress
|
||||
- **`command-executor.test.ts`** — 4 tests: collectInput rejection, cancelCommand
|
||||
|
||||
### Tests
|
||||
- 38 new tests across 6 new test files
|
||||
- Total passing: 379 across 41 test files
|
||||
|
||||
## [2.1.0] - 2026-03-11 — "Store & Adapter"
|
||||
|
||||
### Added
|
||||
- **`command-line-store.test.ts`** — 11 tests covering open/close, search, select command, provide/skip/goBack input, error state
|
||||
- **`storage-adapter.test.ts`** — 10 tests covering InMemoryStorageAdapter CRUD for nodes/edges, batch ops, error handling
|
||||
|
||||
### Tests
|
||||
- 21 new tests across 2 new test files
|
||||
- Total passing: 341 across 35 test files
|
||||
|
||||
## [2.0.0] - 2026-03-11 — "Clean Architecture"
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
- Removed deprecated re-exports `addEdgeToLocalGraphAtom` and `removeEdgeFromLocalGraphAtom` from `graph-mutations.ts` — import from `graph-mutations-edges` instead
|
||||
- Renamed `gesturesV2` → `gestures` namespace export in main barrel
|
||||
|
||||
### Changed
|
||||
- `CANVAS_VERSION` bumped to `'2.0.0'`
|
||||
- Updated 4 source files and 16 test files to import edge atoms from `graph-mutations-edges`
|
||||
|
||||
### Added
|
||||
- **`action-executor.test.ts`** — 8 tests covering createActionContext, createActionContextFromTouchEvent
|
||||
- **`settings-store.test.ts`** — 12 tests covering default state, setEventMapping, resetSettings, togglePanel, virtualization, hasUnsavedChanges
|
||||
|
||||
### Tests
|
||||
- 20 new tests across 2 new test files
|
||||
- Total passing: 320 across 33 test files
|
||||
|
||||
## [1.98.0] - 2026-03-11 — "Commands & Dispatch"
|
||||
|
||||
### Added
|
||||
- **`dispatcher.test.ts`** — 10 tests covering registerAction/unregisterAction, dispatch simple and phase handlers, none action
|
||||
- **`clipboard-commands.test.ts`** — 10 tests covering copy/cut/paste/duplicate/deleteSelected definitions and registration
|
||||
- **`group-commands.test.ts`** — 10 tests covering group/ungroup/collapse/expand definitions and registration
|
||||
|
||||
### Tests
|
||||
- 30 new tests across 3 new test files
|
||||
- Total passing: 300 across 31 test files
|
||||
|
||||
## [1.95.0] - 2026-03-11 — "Final Polish"
|
||||
|
||||
### Added
|
||||
- **`port-types.test.ts`** — 16 tests covering calculatePortPosition, getNodePorts, canPortAcceptConnection, arePortsCompatible
|
||||
- **`command-registry.test.ts`** — 11 tests covering register/unregister, get/has, search, aliases, sorting
|
||||
- **`keyboard-contexts.test.ts`** — 7 tests covering unique IDs, priorities, arrow key and nudge bindings
|
||||
- **`canvas-styles.test.ts`** — 7 tests covering theme structure, mergeWithDefaults, light/dark differences
|
||||
|
||||
### Tests
|
||||
- 44 new tests across 4 new test files
|
||||
- Total passing: 270 across 28 test files
|
||||
|
||||
## [1.9.0] - 2026-03-11 — "Derived & Types"
|
||||
|
||||
### Added
|
||||
- **`event-types.ts`** — CanvasEventType enum, EventTypeInfo, EVENT_TYPE_INFO lookup
|
||||
- **`action-types.ts`** — ActionCategory enum, BuiltInActionId, ActionContext, ActionHelpers, ActionDefinition
|
||||
- **`settings-state-types.ts`** — EventActionMapping, SettingsPreset, CanvasSettingsState, DEFAULT_MAPPINGS
|
||||
- **`graph-derived-atoms.test.ts`** — 8 tests covering highestZIndex, nodeKeys, edgeKeys, reactivity
|
||||
- **`settings-types.test.ts`** — 10 tests covering enum integrity, EVENT_TYPE_INFO coverage, action ID uniqueness
|
||||
- **`canvas-serializer-validation.test.ts`** — 7 tests covering missing fields, wrong version, invalid nodes
|
||||
- **`viewport-store-actions.test.ts`** — 8 tests covering zoom/pan defaults, reset, coordinate transforms
|
||||
|
||||
### Changed
|
||||
- **`settings-types.ts`** — re-export barrel (419→~40L)
|
||||
|
||||
### Tests
|
||||
- 33 new tests across 4 new test files
|
||||
- Total passing: 226 across 24 test files
|
||||
|
||||
## [1.8.0] - 2026-03-11 — "Pipeline Polish"
|
||||
|
||||
### Added
|
||||
- **`gesture-provider-utils.ts`** — isEditableTarget, setHeldKeyValue, applyHeldKeyDelta, getCurrentSubject, getSubjectPosition, buildGuardContext
|
||||
- **`gesture-provider-utils.test.ts`** — 13 tests covering DOM detection, held-key immutability, key delta application
|
||||
- **`timed-state-runner.test.ts`** — 8 tests covering state transitions, tap, double-tap, long-press, cancel, destroy
|
||||
- **`contexts.test.ts`** — 5 tests covering PALM_REJECTION and ACTIVE_INTERACTION context priorities and integrity
|
||||
- **`command-store.test.ts`** — 5 tests covering open/close command line, phase transitions
|
||||
|
||||
### Changed
|
||||
- **`GestureProvider.tsx`** — delegates to `gesture-provider-utils` (347→~215L)
|
||||
|
||||
### Tests
|
||||
- 31 new tests across 4 new test files
|
||||
- Total passing: 193 across 20 test files
|
||||
|
||||
## [1.7.0] - 2026-03-11 — "Gesture Refine"
|
||||
|
||||
### Added
|
||||
- **`keyboard-bindings.ts`** — 24 keyboard shortcut bindings extracted from DEFAULT_CONTEXT
|
||||
- **`pointer-bindings.ts`** — 22 pointer/touch gesture bindings extracted from DEFAULT_CONTEXT
|
||||
- **`minimap-utils.ts`** — computeGraphBounds, getMinimapTransform, minimapToWorld
|
||||
- **`pointer-contexts.test.ts`** — 12 tests covering binding integrity, no duplicate IDs, pick mode contexts
|
||||
- **`minimap-utils.test.ts`** — 8 tests covering bounds calculation, transform, world conversion
|
||||
- **`canvas-serializer-roundtrip.test.ts`** — 9 tests covering export/import round-trip, viewport, offset, validation
|
||||
|
||||
### Changed
|
||||
- **`pointer-contexts.ts`** — assembles DEFAULT_CONTEXT from imported arrays (346→~120L)
|
||||
- **`Minimap.tsx`** — delegates to `minimap-utils` (310→~278L)
|
||||
|
||||
### Tests
|
||||
- 30 new tests across 3 new test files
|
||||
- Total passing: 162 across 16 test files
|
||||
|
||||
## [1.6.0] - 2026-03-11 — "Hook Coverage"
|
||||
|
||||
### Added
|
||||
- **`useCanvasGraph.test.ts`** — 6 tests covering nodeKeys, edgeKeys, getNodeAttributes
|
||||
- **`useCanvasSelection.test.ts`** — 8 tests covering select, deselect, toggle, add, remove, edge selection
|
||||
- **`useCanvasViewport.test.ts`** — 7 tests covering zoom, pan, viewportRect, constants
|
||||
- **`useCanvasHistory.test.ts`** — 6 tests covering recordSnapshot, undo, redo, clear, labels
|
||||
- **`useVirtualization.test.ts`** — 5 tests covering metrics, enable/disable/toggle
|
||||
- **`useCanvasSettings.test.ts`** — 8 tests covering mappings, presets, panel toggle, reset
|
||||
- **`plugin-registry.test.ts`** — 12 tests covering register/unregister, dependencies, conflicts, lifecycle
|
||||
- **`useDragStateMachine.ts`** — buildDragPositions, computeDragUpdates, isDragPrevented
|
||||
- **`useDragConstraints.ts`** — snapToGrid, clampToBounds, applyDragConstraints
|
||||
- **`modifier-helpers.ts`** — isRepeatBlocked, getSelectedNodeIds, getCurrentSubject, updateKeySubject
|
||||
- **`gesture-classification.ts`** — findNearestNode, cycleFocus, navigateFocus, activateFocusedNode
|
||||
|
||||
### Changed
|
||||
- **`useNodeDrag.ts`** — delegates to `useDragStateMachine` helpers (367→~310L)
|
||||
- **`input-action-helpers.ts`** — delegates to `modifier-helpers` + `gesture-classification` (374→~210L)
|
||||
|
||||
### Tests
|
||||
- 52 new tests across 7 new test files
|
||||
- Total passing: 132 across 13 test files
|
||||
|
||||
## [1.5.0] - 2026-03-11 — "Test & Harden"
|
||||
|
||||
### Added
|
||||
- **`graph-mutations.test.ts`** — 10 tests covering addNode, deleteNode, deleteEdge, loadGraphFromDb, drag lifecycle
|
||||
- **`clipboard-store.test.ts`** — 10 tests covering copy, cut, paste, duplicate, edge remapping, guards
|
||||
- **`group-store.test.ts`** — 12 tests covering collapse/expand, parent/child, circular guard, moveToGroup
|
||||
- **`history-store.test.ts`** — 10 tests covering push, undo, redo, clear, labels, edge cases
|
||||
- **`built-in-actions.test.ts`** — 14 tests covering registration, all 18 handler delegations, guards
|
||||
- **`ContextMenuAction`** — standalone touch-friendly action row component
|
||||
- **`ContextMenuDivider`** — section header/separator component
|
||||
- **`ComboboxOption`** — option row with icon, label, description, highlight
|
||||
- **`ComboboxSearch`** — search input with ARIA combobox role
|
||||
- **`EdgePath`** — drag handle visual indicator (44px touch target)
|
||||
- **`EdgeLabel`** — inline edge label positioning component
|
||||
|
||||
### Changed
|
||||
- **`NodeContextMenu.tsx`** — delegates to `ContextMenuAction` + `ContextMenuDivider` (367→~310L)
|
||||
- **`NodeTypeCombobox.tsx`** — delegates to `ComboboxOption` + `ComboboxSearch` (374→~310L)
|
||||
- **`EdgeOverlay.tsx`** — delegates handle to `EdgePath` (349→~310L)
|
||||
|
||||
### Tests
|
||||
- 57 new tests across 5 new test files
|
||||
- Total passing: 97 across 8 test files
|
||||
|
||||
## [1.4.0] - 2026-03-11 — "Stable DB"
|
||||
|
||||
### Added
|
||||
- **Adapter conformance test harness** — `runAdapterConformanceTests(name, factory)` validates any `CanvasStorageAdapter` implementation against the full CRUD + batch contract (15 tests)
|
||||
- **Batch operations** — optional `createNodes`, `deleteNodes`, `createEdges`, `deleteEdges` on `CanvasStorageAdapter` with sequential fallback in `InMemoryStorageAdapter`
|
||||
- **`PortHandle`** — standalone port handle component with drag, hover, and compatibility highlighting
|
||||
- **`SettingsPresets`** — preset management component (apply, save-as, delete, reset)
|
||||
- **`SettingsEventMap`** — event-to-action mapping table component
|
||||
- **`CollectorInputPhase`** — progress/prompt display for command input collection
|
||||
- **`CollectorSelectInput` / `CollectorBooleanInput`** — extracted select option and boolean input components with shared `ShortcutButton`
|
||||
|
||||
### Changed
|
||||
- **`@blinksgg/canvas/db`** — promoted from **Beta → Stable**
|
||||
- **`NodePorts.tsx`** — refactored from 406L → ~110L, delegates to `PortBar` + `PortHandle`
|
||||
- **`CommandInputCollector.tsx`** — refactored from 397L → ~165L, delegates to `CollectorInputPhase` + `CollectorSelectInput`
|
||||
- **`SettingsPanel.tsx`** — refactored from 392L → ~125L, delegates to `SettingsPresets` + `SettingsEventMap`
|
||||
- **`storage-adapter.test.ts`** — refactored to use conformance harness; retains only atom-level tests
|
||||
|
||||
### Tests
|
||||
- **`adapter-conformance.test.ts`** — 14 CRUD + 2 batch tests against `InMemoryStorageAdapter`
|
||||
- **`storage-adapter.test.ts`** — 3 atom integration tests
|
||||
|
||||
## [1.3.0] - 2026-03-11 — "Serialize"
|
||||
|
||||
### Added
|
||||
- **Canvas serialization** — `exportGraph(store)` / `importGraph(store, snapshot)` for full JSON snapshots of nodes, edges, positions, groups, and viewport state
|
||||
- **`CanvasSnapshot`** type — portable JSON schema (version 1) with `SerializedNode`, `SerializedEdge`, `SerializedGroup`, viewport, and metadata fields
|
||||
- **`validateSnapshot(data)`** — runtime schema validation with detailed error reporting
|
||||
- **Import options** — `clearExisting` (default true), `offsetPosition` for paste-at-cursor, `remapIds` for UUID regeneration to avoid conflicts
|
||||
- **Headless API integration** — `exportSnapshot()`, `importSnapshot()`, `validateSnapshot()` on `CanvasAPI`
|
||||
- **Built-in commands** — `exportCanvas` (alias: `export`) copies graph JSON to clipboard; `importCanvas` (alias: `import`) reads, validates, and loads from clipboard
|
||||
- **`createWheelHandler(config)`** — extracted wheel zoom logic into a standalone, testable pure function
|
||||
- **`createPinchHandlers(config)`** — extracted pinch zoom logic (simultaneous pan, velocity sampling, inertia) into a standalone, testable pure function
|
||||
|
||||
### Changed
|
||||
- **`useCanvasGestures.ts`** — refactored from 518 lines to ~370 lines by delegating wheel and pinch zoom to extracted modules
|
||||
- **`gestures/index.ts`** — exports `createWheelHandler`, `WheelZoomConfig`, `createPinchHandlers`, `PinchZoomConfig`
|
||||
- **`builtins/index.ts`** — registers `serialization-commands` alongside existing built-in command sets
|
||||
|
||||
### Tests
|
||||
- **`canvas-serializer.test.ts`** — 18 tests: export (7), import (8), round-trip (1), validation (9)
|
||||
- **`useWheelZoom.test.ts`** — 7 tests: zoom in/out, min/max clamp, guard conditions
|
||||
- **`usePinchZoom.test.ts`** — 5 tests: start/update/end lifecycle, disabled state
|
||||
|
||||
## [1.2.0] - 2026-03-10 — "Plugin API"
|
||||
|
||||
### Added
|
||||
- **Plugin system** — unified `CanvasPlugin` interface bundles node types, commands, actions, gesture contexts, and edge path calculators into a single declarative manifest
|
||||
- **`plugin-types.ts`** — `CanvasPlugin`, `PluginContext`, `PluginRegistration`, `PluginError` class with typed error codes (`ALREADY_REGISTERED`, `NOT_FOUND`, `MISSING_DEPENDENCY`, `CONFLICT`, `LIFECYCLE_ERROR`)
|
||||
- **`plugin-registry.ts`** — `registerPlugin()` / `unregisterPlugin()` with dependency resolution, cross-plugin conflict detection, atomic registration with rollback, and lifecycle hooks (`onRegister` → cleanup)
|
||||
- **`edge-path-registry.ts`** — extensible custom edge path calculator registry; plugins can register new edge path types beyond the 8 built-ins
|
||||
- **`usePlugin()` / `usePlugins()` hooks** — React integration for plugin lifecycle (register on mount, unregister on unmount, dependency-order cleanup)
|
||||
- **`unregisterNodeType()`** — per-type removal for clean plugin teardown
|
||||
- **2 new test suites** — `plugin-registry` (28 tests), `edge-path-registry` (8 tests)
|
||||
- Registration, duplicate detection, dependency resolution, conflict detection across all subsystems
|
||||
- Atomic rollback on lifecycle error, cleanup verification, query functions
|
||||
- Custom edge path precedence over built-ins, clear/unregister behavior
|
||||
|
||||
### Changed
|
||||
- **`Canvas.renderNode` is now optional** — when omitted, the node type registry auto-resolves components by `node.dbData.node_type`, including those registered by plugins. Falls back to `FallbackNodeTypeComponent` for unknown types.
|
||||
- **Barrel exports updated** — plugin types, registry, hooks, and edge path registry all exported from `core/`, `hooks/`, and `utils/` entry points
|
||||
|
||||
## [1.1.0] - 2026-03-10 — "Gesture Modular"
|
||||
|
||||
### Changed
|
||||
- **Split `useRegisterInputActions.ts`** (528L → 259L): extracted `input-action-helpers.ts` (~370L) with all pure store helper functions (navigation, selection, mutation, escape logic)
|
||||
- **Split `useCanvasGestures.ts`** (667L → 518L): extracted `useGuardContext.ts` (~70L) and `useInertia.ts` (~170L)
|
||||
- **3 new modules** — all exported from `@blinksgg/canvas/gestures`:
|
||||
- `input-action-helpers.ts` — `findNearestNode`, `cycleFocus`, `nudgeSelection`, `deleteSelection`, `escapeInput`, etc.
|
||||
- `useGuardContext.ts` — guard context atom reads + stable ref for gesture callbacks
|
||||
- `useInertia.ts` — pan/zoom inertia engines, velocity samplers, pinch tracking
|
||||
|
||||
### Added
|
||||
- **2 new test suites** — `input-action-helpers` (28 tests), `useInertia` (5 tests)
|
||||
- Navigation: `findNearestNode` in all 4 directions, axis preference, fallback behavior
|
||||
- Focus: `cycleFocus` forward/backward, `activateFocusedNode`
|
||||
- Mutations: `nudgeSelection`, `deleteSelection`, `selectAll`
|
||||
- Guards: `isRepeatBlocked`, `getCurrentSubject`, `clearSelectionState`
|
||||
- Zoom: `snapZoom` threshold behavior, constant validation
|
||||
|
||||
### Fixed
|
||||
- **WeakMap for module-level caches** — `_prevUiNodes`, `_edgeCache`, `_positionCache` now use `WeakMap<object, ...>` keyed by Graph instance, preventing cross-store contamination in multi-Canvas setups
|
||||
- **`clearAllPendingMutations()` on graph switch** — mutation queue is now cleared when switching graphs, preventing stale `inFlight` flags from blocking new mutations
|
||||
- **`hasPendingMutations()` checks `queuedUiProperties`** — was only checking `queuedPosition`, missing queued UI property updates
|
||||
- **`collectInput` rejects immediately** — was returning a never-resolving Promise, now throws with a descriptive error message
|
||||
- **`startMutation()` count includes descendants** — was only counting selected nodes, not their group descendants, causing imbalanced `completeMutation()` calls
|
||||
- **Timed-state config threading** — `onUp` now receives `config` parameter and uses `config.multiTapWindowMs` instead of hardcoded default
|
||||
- **localStorage key namespaced** — `'canvas-settings'` → `'@blinksgg/canvas/settings'` to prevent cross-application collisions
|
||||
- **Singleton keyboard routing documented** — `GestureProvider.tsx` now has a comment explaining the intentional global `activeOwnerId` pattern
|
||||
|
||||
---
|
||||
|
||||
## [1.0.0] - 2026-03-10 — "Stable Canvas"
|
||||
|
||||
First stable release. All APIs are now covered by semver guarantees.
|
||||
|
||||
### Added
|
||||
- **API stability document** — `docs/api-stability.md` classifying all exports as Stable, Beta, or Experimental
|
||||
- **Migration guide** — `docs/migration-v1.md` covering v0.x → v1.0 breaking changes
|
||||
- **3 new hook test suites** — `useNodeDrag-atoms`, `useNodeResize-atoms`, `useForceLayout-atoms`
|
||||
- **`peerDependenciesMeta`** — d3-force, @tanstack/react-query, @blocknote/* marked as optional
|
||||
|
||||
### Changed
|
||||
- **Version bump** — 0.36.0 → 1.0.0
|
||||
- **`onAction` callback type** — Now accepts `InputEvent` (pointer + keyboard union) instead of `GestureEvent` (pointer only). Use `event.kind === 'key'` guard to narrow.
|
||||
|
||||
### Highlights
|
||||
- 72+ test suites, 219+ exported atoms, zero TODO/FIXME comments
|
||||
- 8 entry points: root, core, hooks, components, commands, gestures, db, utils
|
||||
- React 19 native with React Compiler auto-memoization
|
||||
- Touch-first gesture pipeline with specificity-scored binding resolution
|
||||
- Local-first with optional Supabase sync via storage adapter
|
||||
- Full headless API for programmatic control without React
|
||||
|
||||
---
|
||||
|
||||
## [0.36.0] - 2026-03-09 — "Gesture Pipeline"
|
||||
|
||||
### Changed
|
||||
- **Split `contexts.ts`** (614L → 100L): extracted `keyboard-contexts.ts` (~200L) + `pointer-contexts.ts` (~280L)
|
||||
|
||||
### Added
|
||||
- **3 new test suites** — `gesture-specificity` (12), `gesture-mapper` (10), `gesture-dispatcher` (10)
|
||||
- Specificity scoring: type/subject/source/modifier/button/key matching
|
||||
- Mapper: context indexing, priority resolution, consumeInput, guards
|
||||
- Dispatcher: handler registry, phase routing, none/unknown handling
|
||||
|
||||
---
|
||||
|
||||
## [0.35.0] - 2026-03-09 — "Gesture Polish"
|
||||
|
||||
### Added
|
||||
- **3 new test suites** — `gesture-inertia` (12), `timed-state` (10), `gesture-normalize` (4)
|
||||
- VelocitySampler, PanInertia, ZoomInertia fully tested
|
||||
- Timed state machine: tap/double-tap/triple-tap/long-press/cancel
|
||||
- Modifier extraction from pointer events
|
||||
|
||||
---
|
||||
|
||||
## [0.34.0] - 2026-03-09 — "Layout Hooks"
|
||||
|
||||
### Changed
|
||||
- **Split `useNodeDrag.ts`** — extracted `DragMemo` + `UseNodeDragOptions` into `hooks/drag-types.ts` (~32L)
|
||||
|
||||
### Added
|
||||
- **2 new test suites** — `gesture-rules-defaults` (8), `keyboard-shortcuts` (5)
|
||||
|
||||
---
|
||||
|
||||
## [0.33.0] - 2026-03-09 — "Settings & Config"
|
||||
|
||||
### Changed
|
||||
- **Split `settings-store.ts`** — extracted presets + utility into `settings-presets.ts` (~85L)
|
||||
|
||||
### Added
|
||||
- **1 new test suite** — `settings-presets` (9 tests: preset config, uniqueness, event coverage, utility)
|
||||
|
||||
---
|
||||
|
||||
## [0.32.0] - 2026-03-09 — "Core Stores"
|
||||
|
||||
### Changed
|
||||
- **Split `history-store.ts`** — extracted pure delta functions into `history-actions.ts` (~160L):
|
||||
- `applyDelta`, `invertDelta`, `createSnapshot` now exported standalone
|
||||
|
||||
### Added
|
||||
- **2 new test suites** — `history-actions` (14), `group-store-utils` (7)
|
||||
|
||||
---
|
||||
|
||||
## [0.31.0] - 2026-03-09 — "Command System"
|
||||
|
||||
### Changed
|
||||
- **Split `commands/store.ts`** (343L) into 2 modules:
|
||||
- `store-atoms.ts` — core state + derived atoms (~95L)
|
||||
- `store.ts` — action atoms + helpers (~260L)
|
||||
|
||||
### Added
|
||||
- **3 new test suites** — `commands-registry` (13), `commands-executor` (3), `commands-store` (15)
|
||||
- Total: 670 tests across 54 files
|
||||
|
||||
---
|
||||
|
||||
## [0.30.0] - 2026-03-09 — "Gesture Engine"
|
||||
|
||||
### Changed
|
||||
- **Split `gesture-rules.ts`** (473L) into 3 focused modules:
|
||||
- `gesture-rules.ts` — scoring, resolver, index (~200L)
|
||||
- `gesture-rules-types.ts` — all type definitions (~117L)
|
||||
- `gesture-rules-defaults.ts` — default rules, labels, merge (~190L)
|
||||
|
||||
### Added
|
||||
- **3 new test suites** — `sync-store` (14), `gesture-rule-store` (12), `gesture-configs` (6)
|
||||
- Total: 639 tests across 51 files
|
||||
|
||||
---
|
||||
|
||||
## [0.29.0] - 2026-03-09 — "Registry Split"
|
||||
|
||||
### Changed
|
||||
- **Split `action-registry.ts`** (449L) into 2 modules:
|
||||
- `action-registry.ts` — registry CRUD + utilities (~120L)
|
||||
- `built-in-actions.ts` — all 20+ built-in action definitions (~340L)
|
||||
|
||||
### Added
|
||||
- **4 new test suites** — `graph-mutations-edges` (10), `graph-mutations-advanced` (8), `debug` (8), `component-registry` (6)
|
||||
- Total: 607 tests across 48 files
|
||||
|
||||
---
|
||||
|
||||
## [0.28.0] - 2026-03-09 — "Modular Mutations"
|
||||
|
||||
### Changed
|
||||
- **Split `graph-mutations.ts`** (524L) into 3 focused modules:
|
||||
- `graph-mutations.ts` — node CRUD, drag lifecycle, DB sync
|
||||
- `graph-mutations-edges.ts` — edge CRUD, animation, label editing
|
||||
- `graph-mutations-advanced.ts` — split/merge nodes, drop target
|
||||
|
||||
### Added
|
||||
- **4 new test suites** — `layout` (11), `hit-test` (4), `action-executor` (8), `mutation-queue` (7)
|
||||
- Total: 575 tests across 44 files
|
||||
|
||||
---
|
||||
|
||||
## [0.27.0] - 2026-03-09 — "Deep Test"
|
||||
|
||||
### Added
|
||||
- **4 new test suites** — `settings-store` (12), `edge-path-calculators` (12), `snap-store` (16), `locked-node-store` (10)
|
||||
- Total: 542 tests across 40 files
|
||||
- **`history-types.ts`** — extracted `HistoryDelta`, `HistoryEntry`, `HistoryState`, `GraphSnapshot` from `history-store.ts`
|
||||
|
||||
---
|
||||
|
||||
## [0.26.0] - 2026-03-09 — "Improve Core"
|
||||
|
||||
### Added
|
||||
- **Minimap edge drawing** — edges render as thin lines between node centers; new `edgeColor` prop
|
||||
- **Fuzzy multi-token search** — split query by whitespace, all tokens must match (order-independent); exported `fuzzyMatch` helper
|
||||
- **Edge search** — search now matches edge labels and types; `searchEdgeResultsAtom`, `searchEdgeResultCountAtom`, `searchTotalResultCountAtom`
|
||||
- **Smart alignment guides** — node-to-node edge/center snapping; `findAlignmentGuides`, `alignmentGuidesAtom`, `AlignmentGuides` component
|
||||
- **2 new test suites** — `alignment-guides.test.ts` (8 tests), 7 fuzzy tests added to `search-store.test.ts`
|
||||
- Total: 489 tests across 36 files
|
||||
|
||||
### Changed
|
||||
- **Clipboard cut** — `cutToClipboardAtom` now actually deletes selected nodes (with undo support via `pushHistoryAtom`)
|
||||
- **Edge search dimming** — `EdgeRenderer` keeps matched edges visible during search (checks `searchEdgeResultsAtom`)
|
||||
|
||||
---
|
||||
|
||||
## [0.25.0] - 2026-03-09 — "Test & Harden"
|
||||
|
||||
### Added
|
||||
- **8 new test suites** (65 tests) — `graph-mutations`, `graph-derived`, `graph-position`, `action-registry`, `interaction-store`, `reduced-motion-store`, `external-keyboard-store`, `toast-store`
|
||||
- Total: 474 tests across 35 files
|
||||
|
||||
### Changed
|
||||
- **Split `TouchActionButton`** — 559-line monolith → 3 files: `icons.tsx` (7 SVGs), `RadialMenu.tsx` (layout + items), `index.tsx` (orchestrator)
|
||||
|
||||
---
|
||||
|
||||
## [0.24.0] - 2026-03-09 — "iPad First"
|
||||
|
||||
### Added
|
||||
- **`prefers-reduced-motion` support** — new `prefersReducedMotionAtom` + `watchReducedMotionAtom`; pan/zoom inertia, animated layouts, and edge fade animations respect the OS setting
|
||||
- **CSS `prefers-reduced-motion`** — all canvas keyframe animations (search pulse, drop target, edge enter/exit, tap pulse) disabled when active
|
||||
- **Undo/redo in `TouchActionButton`** — primary FAB actions on touch devices (with `UndoIcon` / `RedoIcon`)
|
||||
- **External keyboard detection** — `hasExternalKeyboardAtom`; hides `TouchActionButton` when modifier keys are available
|
||||
- **Cursor hiding on touch** — `@media (pointer: coarse)` resets all cursors to `default` via `data-canvas-root`
|
||||
- **`data-canvas-root`** attribute on `Viewport` for CSS targeting
|
||||
|
||||
### Changed
|
||||
- **Safe-area margins** — `ViewportControls` and `TouchActionButton` use `max(16px, env(safe-area-inset-*))` instead of hardcoded `16px`
|
||||
|
||||
---
|
||||
|
||||
## [0.23.0] - 2026-03-09 — "Clean Barrel"
|
||||
|
||||
### Changed
|
||||
- **Slimmed `core/index.ts` barrel** — 458 → 85 lines (replaced 33 named export blocks with `export *`)
|
||||
- **Renamed** `CanvasToast` interface → `CanvasToastData` to resolve name collision with `CanvasToast` component
|
||||
|
||||
### Removed
|
||||
- **`findPortAtPosition`** (deprecated in v0.20) — use `hitTestPort` from `utils/hit-test`
|
||||
- **`resolveGestureIntent` / `isBackgroundGesture`** (deprecated in v0.14) — use `resolveGestureIndexed` from `gesture-rules`
|
||||
- **`gesture-resolver.test.ts`** — tests for removed functions
|
||||
- All `@deprecated` markers cleared from production code
|
||||
|
||||
---
|
||||
|
||||
## [0.22.0] - 2026-03-09 — "Modular Core"
|
||||
|
||||
### Changed
|
||||
- **Split `graph-store.ts`** (914 → 68 lines) into 4 focused modules:
|
||||
- `graph-store.ts` — core atoms (`graphAtom`, `graphUpdateVersionAtom`, drag/edge creation state)
|
||||
- `graph-position.ts` — position management (`nodePositionAtomFamily`, `updateNodePositionAtom`, cleanup)
|
||||
- `graph-derived.ts` — read-only UI state (`uiNodesAtom`, `nodeFamilyAtom`, `edgeFamilyAtom`)
|
||||
- `graph-mutations.ts` — write atoms (CRUD, split/merge, edge animations, DB sync)
|
||||
- **Zero public API changes** — all exports still available from `core/index.ts` barrel
|
||||
- Rewrote 51 import sites (25 production, 24 test, 2 dynamic)
|
||||
|
||||
---
|
||||
|
||||
## [0.21.0] - 2026-03-09 — "Debug"
|
||||
|
||||
### Changed
|
||||
- **Unified logging** — migrated all 33 raw `console.*` calls to `createDebug` with `debug` package namespaces
|
||||
- **`createDebug` extended** — now returns `debug()`, `.warn()`, `.error()` sub-loggers
|
||||
- `.warn()` and `.error()` are always enabled (bypass `DEBUG` filter)
|
||||
- `.warn()` routes to `console.warn`, `.error()` to `console.error`
|
||||
- Enable verbose logging: `localStorage.debug = 'canvas:*'`
|
||||
|
||||
### Files migrated
|
||||
- `useForceLayout.ts` (9 calls), `db/queries/nodes.ts` (5), `db/queries/edges.ts` (4)
|
||||
- `action-executor.ts` (6), `settings-store.ts` (3), `history-store.ts` (2)
|
||||
- `NodeErrorBoundary.tsx` (1), `NodeTypeCombobox.tsx` (1), `useAnimatedLayout.ts` (1), `NoteNode.tsx` (2)
|
||||
|
||||
---
|
||||
|
||||
## [0.20.1] - 2026-03-09
|
||||
|
||||
### Added
|
||||
- **`hitTestNode` / `hitTestPort`** — testable hit-test utilities replacing 5 direct `document.elementFromPoint` calls
|
||||
- **`setHitTestProvider`** — swap DOM hit-testing for mocks in tests or SSR
|
||||
|
||||
### Changed
|
||||
- **`findPortAtPosition`** deprecated — delegates to `hitTestPort`
|
||||
|
||||
---
|
||||
|
||||
## [0.20.0] - 2026-03-09 — "Maintain"
|
||||
|
||||
### Fixed
|
||||
- **`atomFamily` deprecation** — migrated from deprecated `jotai/utils` to `jotai-family` package (prepares for jotai v3, eliminates deprecation warnings)
|
||||
- **Corrupt `graphology` install** — force-reinstalled pnpm store to fix missing dist files
|
||||
|
||||
### Removed
|
||||
- **Dead `CanvasConfig` type** — stale interface with `supabaseUrl`/`supabaseAnonKey` fields (unused, unexported)
|
||||
|
||||
---
|
||||
|
||||
## [0.17.0] - 2026-03-09 — "Connect"
|
||||
|
||||
### Added
|
||||
- **`EdgePreviewLine`** — animated SVG bezier preview during edge creation (dashed line with color states for idle/valid/snapped)
|
||||
- **Drag-from-port** — click a port in `NodePorts` to initiate edge creation (previously only available via `EdgeOverlay` handle)
|
||||
- **Port snap visual** — port dots scale up (1.3x) and glow when a drag is hovering over a compatible port
|
||||
- **`canConnect` validation** — new callback prop on `EdgeOverlay` to reject invalid connections before edge creation
|
||||
|
||||
### Changed
|
||||
- **`EdgeOverlayProps`** — added optional `canConnect` callback
|
||||
- **`NodePorts` / `PortBar`** — port elements now have `onPointerDown` for drag initiation
|
||||
|
||||
---
|
||||
|
||||
## [0.16.0] - 2026-03-09 — "Harden"
|
||||
|
||||
### Removed (breaking)
|
||||
- **`resolveGestureIntent`** — removed from public API; use `resolveGestureIndexed` from gesture-rules instead
|
||||
- **`isBackgroundGesture`** — removed from public API
|
||||
- **`nodeGestureConfig` / `viewportGestureConfig`** — removed deprecated constants; use `getNodeGestureConfig(source)` / `getViewportGestureConfig(source)` functions
|
||||
- **`useSupabaseClient` / `supabaseClientAtom`** — removed from public API; use `useStorageAdapter()` instead
|
||||
- **Legacy Supabase props** — `CanvasDbProvider` and `CanvasProvider` no longer accept `supabaseUrl` / `supabaseAnonKey`; pass an `adapter` prop instead
|
||||
|
||||
### Changed
|
||||
- **`CanvasProviderProps.adapter`** — now required (was optional)
|
||||
- **`CanvasDbProviderProps`** — simplified to single interface (was discriminated union)
|
||||
- **`utils/index.ts`** — exports `getNodeGestureConfig` / `getViewportGestureConfig` functions instead of deprecated constants
|
||||
- **README.md** — refreshed with v0.14 Gesture System v2 and v0.15 Performance sections; updated architecture diagram and state management table
|
||||
|
||||
---
|
||||
|
||||
## [0.15.0] - 2026-03-07 — "Perform"
|
||||
|
||||
### Added
|
||||
- **Spatial grid index** — `SpatialGrid` class with fixed-cell bucketing for O(visible) viewport culling; replaces O(N) linear scan in `visibleNodeKeysAtom`
|
||||
- **`spatialIndexAtom`** — Jotai atom rebuilding the grid on graph structure and position changes
|
||||
- **Performance instrumentation** — `canvasMark` / `canvasWrap` helpers with `performance.mark`/`performance.measure`; opt-in via `setPerfEnabled(true)` or `window.__canvasPerf?.(true)`
|
||||
- **`perfEnabledAtom`** — Jotai atom for perf toggle; `setPerfEnabled` imperative API
|
||||
- **Gestures subpath export** — `@blinksgg/canvas/gestures` for code-splitting the gesture pipeline
|
||||
- 17 new tests covering `SpatialGrid` (12) and perf instrumentation (5)
|
||||
|
||||
### Changed
|
||||
- **`edgeFamilyAtom`** — structural equality cache (`_edgeCache`) prevents re-renders when source/target positions and attributes haven't changed
|
||||
- **`uiNodesAtom`** — structural equality check: returns previous array reference when all entries match by id, position, and isDragging
|
||||
- **`updateNodePositionAtom`** — wrapped with `canvasMark('drag-frame')` for profiling the drag hot path
|
||||
- **`visibleNodeKeysAtom`** — uses `SpatialGrid.query()` + `canvasMark('virtualization-cull')` instead of linear `Array.filter`
|
||||
- **`virtualization-store`** — removed standalone `isNodeVisible` function in favor of spatial grid AABB intersection
|
||||
|
||||
---
|
||||
|
||||
## [0.14.0] - 2026-03-07 — "Unify"
|
||||
|
||||
### Added
|
||||
- **Gesture System v2** — unified pointer + keyboard input pipeline with 4-layer architecture: Normalize → Recognize → Resolve → Dispatch
|
||||
- **Specificity-scored binding resolution** — patterns scored by type (128), key (64), subjectKind (32), modifier (16/8), source (4), button (2); highest score wins across priority-sorted context stack
|
||||
- **Keyboard as parallel input stream** — `KeyInputEvent` type shares resolver and dispatcher with `PointerGestureEvent` via `InputEvent` union; `InputPattern` matches both kinds
|
||||
- **Built-in mapping contexts** — `PALM_REJECTION_CONTEXT` (pri 0), `ACTIVE_INTERACTION_CONTEXT` (pri 15), `SEARCH_CONTEXT` (pri 25), `KEYBOARD_MANIPULATE_CONTEXT` (pri 30), `KEYBOARD_NAVIGATE_CONTEXT` (pri 40), `DEFAULT_CONTEXT` (pri 100)
|
||||
- **Held keys** — `HeldKeysState` tracks pressed keyboard keys; pointer events carry `heldKeys` for patterns like `Space+drag → pan`
|
||||
- **Custom modifiers** — `Modifiers.custom?: Record<string, boolean>` for non-keyboard flags (iPad toolbar buttons, stylus buttons); scored identically to standard modifiers
|
||||
- **Phase-aware action handlers** — `PhaseHandler` interface routes `onStart/onMove/onEnd/onInstant/onCancel` for pointer and `onDown/onUp` for keyboard; simple function handlers fire on `start`/`instant`/`down`
|
||||
- **`consumeInput` flag** — bindings can block lower-priority contexts from matching the same event
|
||||
- **`useGestureSystem` hook** — manages context stack, palm rejection toggle, held key state; produces pre-built `MappingIndex` for O(1) event bucketing
|
||||
- **`useCanvasGestures` hook** — wires pointer events from a viewport ref through the full pipeline with inertia support
|
||||
- **`useNodeGestures` hook** — per-node pointer event handlers feeding the pipeline with `{ kind: 'node', nodeId }` subject
|
||||
- **`useRegisterInputActions` hook** — registers all built-in action handlers (selection, viewport, clipboard, history, layout, navigation, search)
|
||||
- **`useInputModeGestureContext` hook** — auto-pushes/removes input mode contexts (pickNode, pickNodes, pickPoint)
|
||||
- **`GestureProvider` / `InputProvider`** — React context provider wrapping the gesture system for tree-wide access
|
||||
- **Keyboard shortcuts in gesture pipeline** — `/` (command line), `Escape`, `Delete`/`Backspace`, `Ctrl/Cmd+C/X/V/D/A/Z/Y/F/M` all routed through binding resolution instead of ad-hoc key handlers
|
||||
- **Keyboard navigate mode** — Arrow keys move focus, Enter enters manipulate mode, Space activates, Tab cycles nodes
|
||||
- **Keyboard manipulate mode** — Arrow keys nudge selected nodes (Shift = large nudge), Escape exits
|
||||
- **Search keyboard bindings** — `Enter`/`Shift+Enter` and `Ctrl/Cmd+G` cycle search results within gesture pipeline
|
||||
- **`SplitNode`, `GroupNodes`, `MergeNodes`** — added to `BuiltInActionId` enum; registered as proper pipeline actions with `ActionHelpers` callbacks
|
||||
- **Pan inertia** — `PanInertia` class with friction-based deceleration after drag release
|
||||
- **Timed state machine** — `TimedStateRunner` for tap counting, long-press detection, double/triple-tap recognition with configurable thresholds
|
||||
- **Interactive demo** — `GestureV2Demo` with Binding Composer (pointer/keyboard), Event Composer (pointer/keyboard), held key simulation, real-time event log with input kind badges
|
||||
- **Architecture docs** — `packages/canvas/docs/arch-gesture-system-v2.md`, `plan-gesture-system-v2.md`, `plan-keyboard-gesture-integration.md`
|
||||
- **5 new test suites** — specificity (16 tests), mapper (12), timed-state (8), palm-rejection (5), inertia (4)
|
||||
|
||||
### Changed
|
||||
- **`keyboard.ts`** — shortcut handling simplified; most key bindings moved to gesture pipeline contexts
|
||||
- **`Viewport.tsx`** — gesture intent resolution delegated to v2 pipeline when available
|
||||
- **`Node.tsx`** — pointer events can route through `useNodeGestures` pipeline
|
||||
- **`settings-types.ts`** — `ActionContext` gains optional `selectedNodeIds`; `ActionHelpers` gains optional `splitNode`, `groupNodes`, `mergeNodes`
|
||||
- **`interaction-store.ts`** — added `KeyboardInteractionMode` type (`'navigate' | 'manipulate'`) and `keyboardInteractionModeAtom`
|
||||
- **`selection-path-store.ts`** — exported `isSelectingAtom` for guard context access
|
||||
|
||||
---
|
||||
|
||||
## [0.13.0] - 2026-03-05 — "Refine"
|
||||
|
||||
### Added
|
||||
- **Undo/redo for structural operations** — `splitNodeAtom`, `mergeNodesAtom`, `nestNodesOnDropAtom`, `groupSelectedNodesAtom`, `ungroupNodesAtom` now push history snapshots with descriptive labels; all fully undoable
|
||||
- **Undo/redo toast feedback** — `canvasToastAtom`, `showToastAtom` in `toast-store.ts`; `CanvasToast` overlay component shows "Undo: {label}" / "Redo: {label}" for 2 seconds after Ctrl+Z/Y
|
||||
- **Tree layout** — `useTreeLayout` hook: BFS depth assignment, root detection, top-down/left-right direction; `treeLayout` and `horizontalLayout` commands
|
||||
- **Grid layout** — `useGridLayout` hook: spatial-order-preserving grid with auto column count; `gridLayout` command
|
||||
- **Animated layout transitions** — `useAnimatedLayout` shared hook: RAF loop with cubic easing, history snapshot before animation, persistence callback
|
||||
- **Zoom inertia** — pinch-to-zoom continues with momentum after fingers lift (friction=0.88, velocity tracking)
|
||||
- **Snap-to-100% zoom detent** — zoom snaps to 1.0 when within 0.03 threshold (both wheel and pinch)
|
||||
- **Simultaneous pan during pinch** — tracks finger midpoint movement frame-to-frame for fluid two-finger gestures
|
||||
- **Tap pulse animation** — `canvas-tap-pulse` CSS keyframe on ViewportControls buttons for tactile feedback
|
||||
- 19 new tests (404 total) covering undo for split/merge/nest/group/ungroup, tree layout algorithm, grid layout algorithm
|
||||
|
||||
### Changed
|
||||
- **`CommandProvider`** — wires `useTreeLayout` and `useGridLayout` into `CommandContext.layout`
|
||||
- **`useCanvasHistory`** — shows toast with operation label on undo/redo
|
||||
- **`Viewport`** — zoom inertia loop, snap-to-100% in onWheel/onPinch, simultaneous pan tracking in onPinch
|
||||
- **`ViewportControls`** — ControlButton applies `canvas-tap-pulse` class on click
|
||||
- **`CanvasAnimations`** — added `canvas-tap-pulse` keyframe
|
||||
|
||||
---
|
||||
|
||||
## [0.12.0] - 2026-03-05 — "Reshape"
|
||||
|
||||
### Added
|
||||
- **Drag-to-nest** — drag a node over another to nest it as a child; visual drop-target highlight with pulsing blue outline; `dropTargetNodeIdAtom`, `nestNodesOnDropAtom`
|
||||
- **Two-finger split** — two fingers diverging on a node (80px threshold) splits it into two copies with all edges duplicated; `splitNodeAtom`, `useSplitGesture` hook
|
||||
- **Merge nodes** — `Ctrl+M` or command palette merges 2+ selected nodes; edges re-routed to survivor, internal edges discarded; `mergeNodesAtom`, `mergeNodesCommand`
|
||||
- **`split-node` gesture intent** — added to `GestureIntent` type; pinch-on-node now maps to `split-node` instead of `zoom`
|
||||
- **`.canvas-drop-target` CSS** — pulsing blue outline animation for drop target feedback
|
||||
- 18 new tests (385 total) covering nest-on-drop, split-node, merge-nodes
|
||||
|
||||
### Changed
|
||||
- **`useNodeDrag`** — detects drop target via `elementFromPoint` during drag; nests nodes on drop end
|
||||
- **`Node`** — integrates `useSplitGesture` for two-finger split; shows drop-target highlight
|
||||
- **`useGlobalKeyboard`** — added `Ctrl+M` shortcut for merge
|
||||
|
||||
---
|
||||
|
||||
## [0.11.0] - 2026-03-05 — "Interactive"
|
||||
|
||||
### Added
|
||||
- **Nested group drag** — dragging a group node now moves all its descendants (children, nested groups) together via `getNodeDescendants` helper
|
||||
- **Edge deletion animations** — `removeEdgeWithAnimationAtom` snapshots edge state before removal and renders a fade-out animation via `departingEdgesAtom`; `DepartingEdgeItem` renders the exit animation
|
||||
- **Edge creation animations** — CSS fade-in animation class `.canvas-edge-enter` for newly created edges
|
||||
- **Edge label editing** — double-click an edge label to open an inline `<input>` overlay; `editingEdgeLabelAtom` + `updateEdgeLabelAtom` manage state; `EdgeLabelEditor` component positioned at label world coords
|
||||
- **`EdgeLabelEditor`** component — HTML input overlay for inline edge label editing, included automatically in `Canvas`
|
||||
- 14 new tests (367 total) covering nested group drag, departing edges, edge label editing
|
||||
|
||||
### Changed
|
||||
- **`useNodeDrag`** — on first drag frame, expands `initialPositions` to include all descendants of group nodes being dragged
|
||||
- **`edgeFamilyAtom`** — now depends on `graphUpdateVersionAtom` for non-position attribute reactivity (label, color changes)
|
||||
- **`EdgeRenderer`** — renders departing edges with exit animation; edge labels support double-click to edit
|
||||
- **`CanvasAnimations`** — added `canvas-edge-fade-in`, `canvas-edge-fade-out` keyframes and `.canvas-edge-enter`, `.canvas-edge-exit` CSS classes
|
||||
|
||||
---
|
||||
|
||||
## [0.10.0] - 2026-03-05 — "Polish"
|
||||
|
||||
### Added
|
||||
- **Edge re-routing** — `collapsedEdgeRemapAtom` maps collapsed children to their outermost collapsed ancestor; edges visually re-route to the group node instead of disappearing
|
||||
- **Group auto-resize** — `autoResizeGroupAtom` recomputes group bounding box from children with padding; triggered automatically when drag ends on a child node
|
||||
- **Search keyboard shortcuts** — `Ctrl+F` opens search, `Enter`/`Shift+Enter` cycle results, `Ctrl+G`/`Ctrl+Shift+G` alternative navigation, `Escape` clears search before clearing selection
|
||||
- **Edge search dimming** — edges dim to `opacity: 0.2` when search is active and neither endpoint matches, with `150ms` CSS transition
|
||||
- **Search highlight pulse** — currently highlighted search result gets an animated amber box-shadow pulse (`canvas-search-highlight` CSS class)
|
||||
- **`CanvasAnimations`** component — injects CSS keyframes for search pulse and edge transitions
|
||||
- 11 new tests (353 total) covering edge remap, internal edge hiding, cross-boundary edges, auto-resize, and drag-triggered resize
|
||||
|
||||
### Changed
|
||||
- **`visibleEdgeKeysAtom`** — now remap-aware: resolves effective endpoints through `collapsedEdgeRemapAtom`, hides internal edges (both endpoints in same collapsed group)
|
||||
- **`edgeFamilyAtom`** — uses remapped positions when source/target is inside a collapsed group
|
||||
- **`endNodeDragAtom`** — triggers `autoResizeGroupAtom` for the parent group after drag ends
|
||||
- **`useGlobalKeyboard`** — `Escape` now clears search first (before clearing selection)
|
||||
|
||||
---
|
||||
|
||||
## [0.9.0] - 2026-03-05 — "Full Stack"
|
||||
|
||||
### Added
|
||||
- **Abstract persistence** — `CanvasStorageAdapter` interface with `SupabaseStorageAdapter` implementation and `InMemoryStorageAdapter`. `CanvasDbProvider` now accepts an `adapter` prop for any backend
|
||||
- **`storageAdapterAtom`** — Jotai atom for global adapter access; `useStorageAdapter()` hook
|
||||
- **Node grouping** — `parentId` attribute on graph nodes, collapsible container groups with `GroupNode` component
|
||||
- **`group-store`** — `collapsedGroupsAtom`, `toggleGroupCollapseAtom`, `nodeChildrenAtom`, `nodeParentAtom`, `setNodeParentAtom`, `groupSelectedNodesAtom`, `ungroupNodesAtom`, `isNodeCollapsed()` utility
|
||||
- **Group commands** — `groupNodes`, `ungroupNodes`, `collapseGroup`, `expandGroup` registered in command palette
|
||||
- **Search & filter** — `searchQueryAtom`, `searchResultsAtom` (case-insensitive substring match on label/type/id), `highlightedSearchIndexAtom` with next/prev navigation
|
||||
- **Search commands** — `searchNodes` (aliases: `find`, `search`) and `clearSearch` commands
|
||||
- **Node dimming** — non-matching nodes rendered with `opacity: 0.2` and `pointerEvents: none` when search filter is active
|
||||
- **Component tests** — 39 new React component tests (Canvas, Node, Viewport, Minimap, SelectionOverlay, GroupNode) using `@testing-library/react`
|
||||
- 89 new tests (342 total)
|
||||
|
||||
### Changed
|
||||
- **`uiNodesAtom`** — filters out nodes whose ancestor group is collapsed (walks parent chain)
|
||||
- **`CanvasDbProvider`** — accepts union props: `{ adapter }` (primary) or `{ supabaseUrl, supabaseAnonKey }` (legacy, deprecated)
|
||||
- **`CanvasProvider`** — accepts optional `adapter` prop alongside deprecated supabase credential props
|
||||
|
||||
---
|
||||
|
||||
## [0.8.0] - 2026-03-05 — "Full Picture"
|
||||
|
||||
### Added
|
||||
- **Minimap** — `<canvas>`-based overview component showing all nodes with draggable viewport rectangle. Click/drag to pan. Configurable position, size, and colors
|
||||
- **Lasso selection** — pencil drag on background draws freeform lasso path; nodes whose center falls inside the polygon are selected
|
||||
- **Rect selection** — Shift+drag on background draws rectangular selection box; nodes overlapping the rect (AABB intersection) are selected
|
||||
- **`SelectionOverlay`** — SVG component rendering the active lasso/rect path with configurable colors
|
||||
- **`selection-path-store`** — new core store with `startSelectionAtom`, `updateSelectionAtom`, `endSelectionAtom`, `selectionPathAtom`, `selectionRectAtom`
|
||||
- **`pointInPolygon()`** — ray-casting utility for lasso selection, exported from core
|
||||
- **Zoom animations** — `animateZoomToNodeAtom` and `animateFitToBoundsAtom` write atoms for smooth animated viewport transitions with cubic ease-in-out
|
||||
- **`useZoomTransition`** — hook driving requestAnimationFrame-based zoom/pan animation loop
|
||||
- **`zoomAnimationTargetAtom`** — stores current animation target (start/end zoom/pan, duration)
|
||||
- 39 new tests (253 total) covering selection paths, point-in-polygon, and zoom animation atoms
|
||||
|
||||
### Changed
|
||||
- **Viewport.tsx** — now resolves gesture intent once at drag start (with modifier key state) and stores it in a ref, fixing Shift+drag rect-select and pencil lasso
|
||||
- **TODO.md** — marked v0.7 completions, updated roadmap for v0.9+
|
||||
|
||||
---
|
||||
|
||||
## [0.7.0] - 2026-03-05 — "Solid Ground"
|
||||
|
||||
### Added
|
||||
- **Headless Canvas API** — `createCanvasAPI(store)` factory provides all canvas operations (selection, viewport, graph, history, clipboard, snap, virtualization, actions) without React
|
||||
- **`buildActionHelpers(store)`** — pure Jotai store-based ActionHelpers construction, extracted from `useActionExecutor` for headless use
|
||||
- **`fitToBoundsAtom`** — headless write atom for fitting viewport to graph or selection bounds
|
||||
- **`centerOnNodeAtom`** — headless write atom for centering viewport on a specific node
|
||||
- **Arrow key navigation** — spatial keyboard navigation between nodes (Arrow keys = directional focus, Enter/Space = select, Tab = cycle by z-index)
|
||||
- **`focusedNodeIdAtom`** — keyboard focus state, distinct from selection, with visual focus ring
|
||||
- **`useArrowKeyNavigation` hook** — React hook for enabling keyboard navigation
|
||||
- **`useCanvasGraph` hook** — convenience hook for graph structure access (nodeCount, edgeCount, getNode, getEdge)
|
||||
- **214 unit tests** — comprehensive coverage for graph-store, selection-store, history-store, clipboard-store, viewport-store, virtualization-store, and canvas-api (up from 47)
|
||||
|
||||
### Changed
|
||||
- **Edge re-render optimization** — `edgeFamilyAtom` no longer depends on `nodePositionUpdateCounterAtom` (global counter). Reactivity flows through `nodePositionAtomFamily` with structural equality caching. Performance: O(connected edges) per drag frame instead of O(all edges)
|
||||
- **`useActionExecutor` simplified** — refactored to use `buildActionHelpers` internally (~30 lines from ~160)
|
||||
- **`useFitToBounds` simplified** — delegates to `fitToBoundsAtom` instead of inline computation
|
||||
- **Position atom caching** — `nodePositionAtomFamily` returns same object reference for unchanged positions via `_positionCache` Map
|
||||
|
||||
### Fixed
|
||||
- Position atom cleanup now also clears the position cache to prevent stale references
|
||||
|
||||
---
|
||||
|
||||
## [0.6.0] - 2026-03-03
|
||||
|
||||
### Changed
|
||||
- **React Compiler integration** — automatic memoization replaces 110 `useCallback`, 25 `useMemo`, 2 `React.memo`
|
||||
- **Context as JSX** — 3 providers modernized (`CanvasStyleProvider`, `CommandProvider`, `CanvasDbProvider`)
|
||||
- **Ref cleanup** — `CanvasStyleProvider` uses ref callback with cleanup for CSS variable lifecycle
|
||||
|
||||
### Removed
|
||||
- **Dropped React 18** — peerDependencies require `react@^19.0.0`
|
||||
|
||||
---
|
||||
|
||||
## [0.5.0] - 2026-03-03
|
||||
|
||||
### Added
|
||||
- `NodeClick` event type — single-click events on nodes now flow through the action executor
|
||||
- `EdgeHover` / `EdgeLeave` observability callbacks on `Canvas`
|
||||
- `React.memo` on `EdgeItem` component for render optimization
|
||||
|
||||
### Fixed
|
||||
- `ConnectedNodeRenderer` virtualization — switched from `nodeKeysAtom` to `visibleNodeKeysAtom`
|
||||
- `ConnectedNode` forwards `onClick`, `onHover`, `onLeave` props correctly
|
||||
- `history-store` typed assertion for delta type checking
|
||||
|
||||
---
|
||||
|
||||
## [0.4.0] - 2026-03-03
|
||||
|
||||
### Added
|
||||
- **Edge events** — `EdgeClick`, `EdgeDoubleClick`, `EdgeRightClick` with callback props on `Canvas`
|
||||
- **Observability callbacks** — `onSelectionChange`, `onViewportChange`, `onDragStart`, `onDragEnd`, `onNodeHover`, `onNodeLeave`
|
||||
- **Strong type contracts** — `UINodeProperties` replaces `Record<string, unknown>`, `UINodeState` replaces `any` in event callbacks
|
||||
- `SelectEdge` built-in action in the action registry
|
||||
|
||||
---
|
||||
|
||||
## [0.3.0] - 2026-03-03
|
||||
|
||||
### Added
|
||||
- All 8 event-action mappings fully wired (`NodeRightClick`, `NodeLongPress`, `BackgroundClick`)
|
||||
- `BackgroundClick` routed through action executor when `onBackgroundClick` prop is provided
|
||||
|
||||
### Fixed
|
||||
- `centerOnNode` viewport calculation — correctly reads node position from graph store
|
||||
|
||||
---
|
||||
|
||||
## [0.2.x] - 2025-01-14
|
||||
|
||||
### Added
|
||||
|
||||
#### Settings Panel
|
||||
- `CanvasEventType` enum for all canvas events (double-click, triple-click, right-click, long-press)
|
||||
- `ActionRegistry` with `registerAction()` for custom actions
|
||||
- Built-in actions: selection, viewport, node, layout, history (17 total)
|
||||
- `useCanvasSettings()` hook, `useActionExecutor()` hook
|
||||
- `SettingsPanel` headless UI component
|
||||
- Three built-in presets: Default, Minimal, Power User
|
||||
- `localStorage` persistence via `atomWithStorage`
|
||||
|
||||
#### Layout System
|
||||
- `useFitToBounds()`, `useGetGraphBounds()`, `useSelectionBounds()`, `useForceLayout()`
|
||||
- Layout utilities: `calculateBounds()`, `checkNodesOverlap()`, `getNodeCenter()`
|
||||
|
||||
#### Command Palette
|
||||
- `@blinksgg/canvas/commands` subpath export
|
||||
- `CommandProvider`, `CommandLine`, `CommandSearch`, `CommandInputCollector`, `CommandFeedbackOverlay`
|
||||
- `registerBuiltinCommands()`, `registerCommand()`, `useCommandLine()`, `useGlobalKeyboard()`
|
||||
- Keyboard shortcuts: `/`, `Cmd+K`, `Escape`
|
||||
|
||||
#### Clipboard
|
||||
- Local-first copy/cut/paste/duplicate (`Ctrl+C/X/V/D`)
|
||||
|
||||
#### Virtualization
|
||||
- Viewport culling (+200px buffer)
|
||||
|
||||
#### Connection Ports
|
||||
- `PortDefinition`, `NodePorts` component, `calculatePortPosition()`, `arePortsCompatible()`
|
||||
|
||||
#### Input System
|
||||
- `classifyPointer()` for finger/pencil/mouse classification
|
||||
- `resolveGestureIntent()` with palm rejection
|
||||
- Touch/stylus support with device-aware thresholds
|
||||
|
||||
#### Other
|
||||
- `d3-force` added as peer dependency
|
||||
|
||||
---
|
||||
|
||||
## [0.2.0] - 2025-01-07
|
||||
|
||||
### Added
|
||||
- **Subscription hooks** for reactive state access:
|
||||
- `useCanvasSelection()`, `useCanvasViewport()`, `useCanvasDrag()`
|
||||
- **New subpath export** `@blinksgg/canvas/hooks`
|
||||
- **Configurable edge paths** with 8 path types:
|
||||
- `bezier` (default), `bezier-vertical`, `bezier-smart`
|
||||
- `straight`, `step`, `step-vertical`, `step-smart`, `smooth-step`
|
||||
- Edge path calculator utilities from `@blinksgg/canvas/utils`
|
||||
|
||||
### Changed
|
||||
- `EdgeRenderer` uses configurable path calculators instead of hardcoded bezier curves
|
||||
|
||||
---
|
||||
|
||||
## [0.1.0] - 2025-01-01
|
||||
|
||||
### Added
|
||||
- Initial release
|
||||
- Core state management with Jotai atoms
|
||||
- Node drag, resize, and selection
|
||||
- Edge creation and management
|
||||
- Viewport pan/zoom with gesture support
|
||||
- Supabase sync integration
|
||||
- Style theming system with CSS variables
|
||||
- Undo/redo history support
|
||||
|
||||
---
|
||||
|
||||
## Breaking Changes Guide
|
||||
|
||||
### Upgrading to 0.6.0
|
||||
|
||||
- **React 18 is no longer supported.** Update to React 19.
|
||||
- No API changes — the React Compiler handles memoization automatically.
|
||||
|
||||
### Upgrading to 0.2.0
|
||||
|
||||
No breaking changes. Subscription hooks are recommended over direct atom imports:
|
||||
|
||||
```tsx
|
||||
// Before
|
||||
import { selectedNodeIdsAtom } from '@blinksgg/canvas/core';
|
||||
const selectedNodeIds = useAtomValue(selectedNodeIdsAtom);
|
||||
|
||||
// After (recommended)
|
||||
import { useCanvasSelection } from '@blinksgg/canvas/hooks';
|
||||
const { selectedNodeIds, count, hasSelection } = useCanvasSelection();
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Version Policy
|
||||
|
||||
- **MAJOR** version: Breaking changes (removed/renamed exports, changed return types)
|
||||
- **MINOR** version: New features (new hooks, components, options)
|
||||
- **PATCH** version: Bug fixes (no API changes)
|
||||
73
PRINCIPLES.md
Normal file
73
PRINCIPLES.md
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
# @blinksgg/canvas — Core Principles
|
||||
|
||||
These principles guide every design decision in the canvas library.
|
||||
When in doubt, refer here. When principles conflict, earlier ones win.
|
||||
|
||||
## 1. Touch-first, mouse-compatible
|
||||
|
||||
Design for fingers and stylus first, then ensure mouse works well.
|
||||
Every interaction has device-aware thresholds — 44px hit targets for
|
||||
fingers, 3px drag thresholds for pencil, palm rejection when stylus
|
||||
is active. Mouse is not the default; it is one of three equal input
|
||||
sources.
|
||||
|
||||
> "Pencil draws, fingers navigate, mouse does both."
|
||||
> — input-classifier.ts
|
||||
|
||||
## 2. Headless core, optional UI
|
||||
|
||||
All state lives in Jotai atoms with zero React dependency. The `core/`
|
||||
layer is a pure state machine: atoms in, atoms out. Components in
|
||||
`components/` are one possible UI — consumers can build entirely
|
||||
custom UIs by importing only `@blinksgg/canvas/core` and
|
||||
`@blinksgg/canvas/hooks`.
|
||||
|
||||
## 3. Local-first, sync-optional
|
||||
|
||||
Every operation (drag, resize, copy, paste, undo, redo) works without
|
||||
a network connection. The clipboard is in-memory. Undo/redo uses
|
||||
delta-based snapshots in local state. The database layer (`db/`) is
|
||||
an optional add-on with an adapter interface — not a requirement.
|
||||
|
||||
## 4. Events are data, actions are configurable
|
||||
|
||||
Canvas interactions produce typed events (NodeDoubleClick,
|
||||
BackgroundLongPress, etc.). What *happens* in response is a mapping
|
||||
in a settings store, not hardcoded logic. Users remap actions via
|
||||
presets or the SettingsPanel. This separates "what happened" from
|
||||
"what to do about it."
|
||||
|
||||
## 5. Atoms over context
|
||||
|
||||
Prefer Jotai atoms over React context for shared state. Atoms are
|
||||
composable, testable without React, and don't cause provider
|
||||
waterfall re-renders. Use React context only for non-reactive
|
||||
configuration (style themes, callback refs).
|
||||
|
||||
## 6. Fully controllable headless API
|
||||
|
||||
Every canvas operation must be executable from the `core/` layer
|
||||
without React. If a hook can do it, an atom or pure function in
|
||||
`core/` can do it too. The React hooks are convenience wrappers,
|
||||
not the only path. External tools, tests, and non-React integrations
|
||||
should have full control via `store.set(atom, value)`.
|
||||
|
||||
## 7. Performance by default
|
||||
|
||||
Virtualization is on by default (only render visible nodes).
|
||||
The React Compiler handles memoization automatically. Edge paths
|
||||
only recompute when their connected nodes move. Delta-based history
|
||||
is O(1) for moves instead of O(N) full-graph snapshots.
|
||||
|
||||
## 8. Composition over configuration
|
||||
|
||||
Provide small, focused hooks (`useNodeDrag`, `useNodeResize`,
|
||||
`useTapGesture`) that compose into complex behavior. The `Canvas`
|
||||
component is a convenient composition — not the only way to use the
|
||||
library. Advanced users compose hooks directly.
|
||||
|
||||
## 9. Backend-agnostic persistence
|
||||
|
||||
The `CanvasStorageAdapter` interface defines CRUD + subscriptions.
|
||||
Implement it for any backend. The simplest path is callback props
|
||||
(`onNodePersist`) with no adapter at all.
|
||||
259
TODO.md
Normal file
259
TODO.md
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
# @blinksgg/canvas — TODO
|
||||
|
||||
## Known Gaps
|
||||
|
||||
_(None currently)_
|
||||
|
||||
## v3.x Roadmap
|
||||
|
||||
- ~~React Compiler integration~~ ✅ (v3.0.0)
|
||||
- **v3.1 — Remaining Phase 1 cleanup** — remove `useMemo`/`useCallback` from `Minimap.tsx`, `db/provider.tsx`, `useSplitGesture.ts` (see `plan-react19-canvas-optimization.md`)
|
||||
- **v3.2 — Ref cleanup callbacks** — adopt React 19 ref cleanup in `Viewport.tsx`
|
||||
- **v3.3 — Dev Overlay** — floating debug panel with graph stats, event log, perf metrics
|
||||
- **v3.4 — Multi-user Cursors** — realtime cursor presence for collaborative editing
|
||||
|
||||
## Open Issues
|
||||
|
||||
_(None currently)_
|
||||
|
||||
## Completed in v3.0.0
|
||||
|
||||
- **React Compiler** — integrated `babel-plugin-react-compiler` + `@vitejs/plugin-react`
|
||||
- **Removed all manual memoization** — 6 `useCallback` + 3 `useMemo` across 5 files
|
||||
- **Peer deps** — `react`/`react-dom` `^19.0.0` → `^19.2.0`
|
||||
- **Version** — 1.0.0 → 3.0.0
|
||||
|
||||
## Completed in v2.5.0
|
||||
|
||||
- **First React hook integration tests** — `renderHook` from `@testing-library/react`
|
||||
- **4 new test suites** — `animated-layout` (9), `useActionExecutor-hook` (6), `usePlugin-hook` (5), `useLayout-hook` (4)
|
||||
- **Exported `easeInOutCubic`** from `useAnimatedLayout.ts` for independent testing
|
||||
|
||||
## Completed in v2.4.0
|
||||
|
||||
- **4 new test suites** — `drag-state-machine` (11), `action-types-enums` (9), `event-types-enums` (10), `gesture-rules-types` (6)
|
||||
|
||||
## Completed in v2.3.0
|
||||
|
||||
- **5 new test suites** — `actions-node`, `actions-viewport`, `modifier-helpers`, `pointer-bindings-v2`, `plugin-types` (34 tests)
|
||||
|
||||
## Completed in v2.2.0
|
||||
|
||||
- **Split `built-in-actions.ts`** (342L → 44L barrel) into `actions-node.ts` + `actions-viewport.ts`
|
||||
- **6 new test suites** — keyboard-bindings, gesture-classification, viewport-commands, serialization-commands, store-atoms, command-executor (38 tests)
|
||||
|
||||
## Completed in v2.1.0
|
||||
|
||||
- **2 new test suites** — `command-line-store` (11), `storage-adapter` (10)
|
||||
|
||||
## Completed in v2.0.0
|
||||
|
||||
- **Renamed `gesturesV2` → `gestures`** — clean namespace
|
||||
- **Removed deprecated re-exports** — `action-executor`, `settings-store` test suites added
|
||||
|
||||
## Completed in v1.2.0
|
||||
|
||||
- **Plugin system** — unified `CanvasPlugin` manifest with dependency resolution, conflict detection, atomic registration/rollback, and lifecycle hooks
|
||||
- **4 new files** — `plugin-types.ts`, `plugin-registry.ts`, `edge-path-registry.ts`, `usePlugin.ts`
|
||||
- **Canvas auto-routing** — `renderNode` now optional; node type registry resolves components by `node_type`
|
||||
- **`unregisterNodeType()`** — per-type removal for clean plugin teardown
|
||||
- **2 new test suites** — `plugin-registry` (28 tests), `edge-path-registry` (8 tests)
|
||||
|
||||
## Completed in v1.1.0
|
||||
|
||||
- **Split `useRegisterInputActions.ts`** (528L → 259L) — extracted `input-action-helpers.ts` with pure store helpers for navigation, selection, mutation, and escape logic
|
||||
- **Split `useCanvasGestures.ts`** (667L → 518L) — extracted `useGuardContext.ts` and `useInertia.ts` for guard context and inertia management
|
||||
- **2 new test suites** — `input-action-helpers` (28 tests), `useInertia` (5 tests)
|
||||
- **8 bug fixes** — WeakMap cache isolation, mutation queue clearing, balanced startMutation counts, config threading, localStorage namespacing, and more
|
||||
|
||||
## Completed in v1.0.0
|
||||
|
||||
- **API Stability audit** — all 219+ atoms verified for `{noun}{Verb}Atom` naming; `docs/api-stability.md` classifying all 8 entry points
|
||||
- **Migration guide** — `docs/migration-v1.md` covering breaking changes from v0.x → v1.0
|
||||
- **Peer dep cleanup** — `peerDependenciesMeta` marking d3-force, @blocknote/*, @tanstack/react-query as optional
|
||||
- **Hook test coverage** — 3 new test suites for useNodeDrag, useNodeResize, useForceLayout atoms
|
||||
- **Version bump** — package.json, index.ts, CHANGELOG.md, README.md all at 1.0.0
|
||||
|
||||
## Completed in v0.36.0
|
||||
|
||||
- **Split `contexts.ts`** (614L → 100L) into `keyboard-contexts.ts` + `pointer-contexts.ts`
|
||||
- **3 new test suites** — gesture-specificity, gesture-mapper, gesture-dispatcher (~30 tests)
|
||||
|
||||
## Completed in v0.35.0
|
||||
|
||||
- **3 new test suites** — gesture-inertia, timed-state, gesture-normalize (+26 tests)
|
||||
- Covers VelocitySampler, PanInertia, ZoomInertia, timed state machine, modifier extraction
|
||||
|
||||
## Completed in v0.34.0
|
||||
|
||||
- **Split `useNodeDrag.ts`** — extracted drag types into `hooks/drag-types.ts`
|
||||
- **2 new test suites** — gesture-rules-defaults, keyboard-shortcuts (+13 tests)
|
||||
|
||||
## Completed in v0.33.0
|
||||
|
||||
- **Split `settings-store.ts`** — extracted presets + utility into `settings-presets.ts`
|
||||
- **1 new test suite** — settings-presets (+9 tests)
|
||||
|
||||
## Completed in v0.32.0
|
||||
|
||||
- **Split `history-store.ts`** — extracted pure delta functions into `history-actions.ts`
|
||||
- **2 new test suites** — history-actions, group-store-utils (+21 tests)
|
||||
|
||||
## Completed in v0.31.0
|
||||
|
||||
- **Split `commands/store.ts`** into state atoms + action atoms
|
||||
- **3 new test suites** — commands-registry, commands-executor, commands-store (+31 tests, 670 total)
|
||||
|
||||
## Completed in v0.30.0
|
||||
|
||||
- **Split `gesture-rules.ts`** into types + defaults + resolver
|
||||
- **3 new test suites** — sync-store, gesture-rule-store, gesture-configs (+32 tests, 639 total)
|
||||
|
||||
## Completed in v0.29.0
|
||||
|
||||
- **Split `action-registry.ts`** into registry + built-in-actions
|
||||
- **4 new test suites** — graph-mutations-edges, graph-mutations-advanced, debug, component-registry (+32 tests, 607 total)
|
||||
|
||||
## Completed in v0.28.0
|
||||
|
||||
- **Split `graph-mutations.ts`** into 3 modules (node, edge, advanced)
|
||||
- **4 new test suites** — layout, hit-test, action-executor, mutation-queue (+33 tests, 575 total)
|
||||
|
||||
## Completed in v0.27.0
|
||||
|
||||
- **4 new test suites** — settings-store, edge-path-calculators, snap-store, locked-node-store (+53 tests, 542 total)
|
||||
- **`history-types.ts`** — modularized history type definitions
|
||||
|
||||
## Completed in v0.26.0
|
||||
|
||||
- **Minimap edges** — draw edge lines between node centers
|
||||
- **Fuzzy search** — multi-token, edge labels/types, EdgeRenderer integration
|
||||
- **Smart alignment guides** — node-to-node snapping with AlignmentGuides component
|
||||
- **Clipboard cut** — now deletes nodes with undo support (489 tests, 36 files)
|
||||
|
||||
## Completed in v0.25.0
|
||||
|
||||
- **8 new test suites** — graph-mutations, graph-derived, graph-position, action-registry, interaction-store, reduced-motion, external-keyboard, toast (474 total across 35 files)
|
||||
- **Split TouchActionButton** — 559 → 3 files (icons, RadialMenu, index)
|
||||
|
||||
## Completed in v0.24.0
|
||||
|
||||
- **`prefers-reduced-motion`** — atom + CSS + 3 JS consumers (inertia, layout, edge fade)
|
||||
- **Undo/redo in FAB** — primary actions with UndoIcon/RedoIcon
|
||||
- **Safe-area margins** — ViewportControls + TouchActionButton
|
||||
- **Cursor hiding** — `@media (pointer: coarse)` + `data-canvas-root`
|
||||
- **External keyboard detection** — hides FAB when modifier keys available
|
||||
|
||||
## Completed in v0.23.0
|
||||
|
||||
- **Slimmed barrel** — `core/index.ts` 458 → 85 lines (`export *` for all modules)
|
||||
- **Removed deprecated** — `findPortAtPosition`, `resolveGestureIntent`, `isBackgroundGesture`
|
||||
|
||||
## Completed in v0.22.0
|
||||
|
||||
- **Split `graph-store.ts`** — 914 → 68 lines, 3 new modules (`graph-position`, `graph-derived`, `graph-mutations`)
|
||||
|
||||
## Completed in v0.21.0
|
||||
|
||||
- **Unified logging** — 33 `console.*` → `createDebug` with `.warn()/.error()` sub-loggers
|
||||
|
||||
## Completed in v0.20.0
|
||||
|
||||
- **`atomFamily` migration** — `jotai/utils` → `jotai-family` (jotai v3 ready)
|
||||
- **Dead `CanvasConfig` type removed** — stale Supabase fields
|
||||
- **`hitTestNode` / `hitTestPort`** — testable hit-test utilities replacing DOM coupling
|
||||
|
||||
## Completed in v0.17.0
|
||||
|
||||
- **EdgePreviewLine** — animated SVG bezier preview during drag
|
||||
- **Drag-from-port** — click port to start edge creation
|
||||
- **Port snap visual** — glow + scale on compatible ports during drag
|
||||
- **`canConnect` validation** — callback to reject invalid connections
|
||||
|
||||
## Completed in v0.16.0
|
||||
|
||||
- **Deprecated export removal** — `resolveGestureIntent`, legacy gesture configs, `useSupabaseClient`, Supabase provider props
|
||||
- **README refresh** — Gesture System v2, Performance, updated architecture
|
||||
- **TODO cleanup** — removed shipped items, added real roadmap
|
||||
|
||||
## Completed in v0.15.0
|
||||
|
||||
- **Spatial grid index** — `SpatialGrid` for O(visible) node culling in virtualization
|
||||
- **Edge structural equality** — `_edgeCache` prevents re-renders when data hasn't changed
|
||||
- **`uiNodesAtom` structural equality** — previous array reuse when entries match
|
||||
- **Performance instrumentation** — `canvasMark`/`canvasWrap` with opt-in `setPerfEnabled`
|
||||
- **Gestures subpath export** — `@blinksgg/canvas/gestures` for code splitting
|
||||
- **17 new tests** — spatial-index (12), perf (5)
|
||||
|
||||
## Completed in v0.14.0
|
||||
|
||||
- **Gesture System v2** — unified pointer + keyboard input pipeline with 4-layer architecture
|
||||
- **Specificity-scored binding resolution** — patterns scored by type, key, subjectKind, modifier, source, button
|
||||
- **Built-in mapping contexts** — palm rejection, active interaction, search, keyboard navigate/manipulate, default
|
||||
- **Held keys + custom modifiers** — `HeldKeysState`, `Modifiers.custom` for non-keyboard flags
|
||||
- **Phase-aware action handlers** — `PhaseHandler` with onStart/onMove/onEnd/onInstant/onCancel
|
||||
- **5 new test suites** — specificity, mapper, timed-state, palm-rejection, inertia
|
||||
|
||||
## Completed in v0.13.0
|
||||
|
||||
- **Undo/redo for structural operations** — split, merge, nest, group, ungroup all push history snapshots
|
||||
- **Undo/redo toast** — `CanvasToast` shows operation label on Ctrl+Z/Y
|
||||
- **Tree layout** — `useTreeLayout` hook + `treeLayout`/`horizontalLayout` commands
|
||||
- **Grid layout** — `useGridLayout` hook + `gridLayout` command
|
||||
- **Animated layout transitions** — `useAnimatedLayout` shared hook with cubic easing
|
||||
- **Zoom inertia** — momentum after pinch-to-zoom lifts
|
||||
- **Snap-to-100% zoom** — detent at 1.0x zoom
|
||||
- **Simultaneous pan during pinch** — fluid two-finger gestures
|
||||
- **Tap pulse on controls** — `canvas-tap-pulse` CSS animation
|
||||
- **19 new tests** — 404 total
|
||||
|
||||
## Completed in v0.12.0
|
||||
|
||||
- **Drag-to-nest** — drag a node over another to nest; `dropTargetNodeIdAtom`, `nestNodesOnDropAtom`, drop-target highlight CSS
|
||||
- **Two-finger split** — diverging fingers split a node into two copies with duplicated edges; `splitNodeAtom`, `useSplitGesture`
|
||||
- **Merge nodes** — `Ctrl+M` merges selected nodes; edges re-routed, internal edges discarded; `mergeNodesAtom`, `mergeNodesCommand`
|
||||
- **`split-node` gesture intent** — pinch-on-node now maps to split instead of zoom
|
||||
- **18 new tests** — 385 total
|
||||
|
||||
## Completed in v0.11.0
|
||||
|
||||
- **Nested group drag** — `getNodeDescendants` helper + `useNodeDrag` expands initialPositions to include all descendants
|
||||
- **Edge creation/deletion animations** — `departingEdgesAtom` + `removeEdgeWithAnimationAtom` for fade-out; CSS fade-in for new edges
|
||||
- **Edge label editing** — `editingEdgeLabelAtom` + `updateEdgeLabelAtom` + `EdgeLabelEditor` component with inline HTML input
|
||||
- **`edgeFamilyAtom` reactivity fix** — now depends on `graphUpdateVersionAtom` for non-position attribute changes
|
||||
- **14 new tests** — 367 total
|
||||
|
||||
## Completed in v0.10.0
|
||||
|
||||
- **Edge re-routing** — `collapsedEdgeRemapAtom` maps collapsed children to outermost collapsed ancestor; edges re-route to group node
|
||||
- **Group auto-resize** — `autoResizeGroupAtom` recomputes group bounding box on drag end
|
||||
- **Search keyboard shortcuts** — Ctrl+F, Enter/Shift+Enter, Ctrl+G, Escape
|
||||
- **Edge search dimming** — edges dim with 150ms transition when neither endpoint matches
|
||||
- **Search highlight pulse** — amber box-shadow animation on highlighted result
|
||||
- **`CanvasAnimations`** component — CSS keyframe injection
|
||||
- **11 new tests** — 353 total
|
||||
|
||||
## Completed in v0.9.0
|
||||
|
||||
- **Abstract persistence** — `CanvasStorageAdapter` interface, `SupabaseStorageAdapter`, `InMemoryStorageAdapter`, `storageAdapterAtom`
|
||||
- **Node grouping** — `parentId` on nodes, `GroupNode` component, collapse/expand, group commands
|
||||
- **Search & filter** — `searchQueryAtom`, `searchResultsAtom`, node dimming, search commands
|
||||
- **Component tests** — 39 React component tests (Canvas, Node, Viewport, Minimap, SelectionOverlay, GroupNode)
|
||||
- **89 new tests** — 342 total
|
||||
|
||||
## Completed in v0.8.0
|
||||
|
||||
- **Minimap** — `<canvas>`-based overview with draggable viewport rectangle
|
||||
- **Lasso selection** — pencil freeform selection with point-in-polygon test
|
||||
- **Rect selection** — Shift+drag rectangle selection with AABB intersection
|
||||
- **Zoom animations** — `animateZoomToNodeAtom`, `animateFitToBoundsAtom` with cubic easing
|
||||
- **`useZoomTransition`** — rAF-based animation hook
|
||||
- **39 new tests** — selection-path-store + zoom-transition
|
||||
|
||||
## Completed in v0.7.0
|
||||
|
||||
- **Arrow key navigation** — spatial navigation between nodes with Tab cycling and focus ring
|
||||
- **Edge re-render optimization** — O(connected edges) per drag frame instead of O(all edges)
|
||||
- **Test coverage** — 47 → 214 tests covering all core stores + headless API
|
||||
- **Headless API** — `createCanvasAPI(store)` for full programmatic control without React
|
||||
- **Doc consolidation** — PRINCIPLES.md + single README.md + TODO.md
|
||||
174
canvas-demo/dist/assets/index-B9jgFSpQ.js
vendored
Normal file
174
canvas-demo/dist/assets/index-B9jgFSpQ.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
canvas-demo/dist/assets/index-BbLtK4h-.css
vendored
Normal file
1
canvas-demo/dist/assets/index-BbLtK4h-.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
canvas-demo/dist/assets/inter-v12-latin-100-46Mq0mOp.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-100-46Mq0mOp.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-100-BQDzDElq.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-100-BQDzDElq.woff2
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-200-BxfrU12A.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-200-BxfrU12A.woff2
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-200-DXfqWPZg.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-200-DXfqWPZg.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-300-DEbyFmpd.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-300-DEbyFmpd.woff2
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-300-f7r92Nkj.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-300-f7r92Nkj.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-500-BQ2gQN_M.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-500-BQ2gQN_M.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-500-DfX5FI9E.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-500-DfX5FI9E.woff2
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-600-BvOeHRLc.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-600-BvOeHRLc.woff2
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-600-D01NXWOK.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-600-D01NXWOK.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-700-B5TOIllR.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-700-B5TOIllR.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-700-Bj1B9WKG.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-700-Bj1B9WKG.woff2
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-800-Bdy4lAMa.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-800-Bdy4lAMa.woff2
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-800-DFVvDWwT.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-800-DFVvDWwT.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-900-CMga-52B.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-900-CMga-52B.woff2
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-900-ORHAl5ZU.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-900-ORHAl5ZU.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-regular-CahmJf_6.woff
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-regular-CahmJf_6.woff
vendored
Normal file
Binary file not shown.
BIN
canvas-demo/dist/assets/inter-v12-latin-regular-YtgfLPRn.woff2
vendored
Normal file
BIN
canvas-demo/dist/assets/inter-v12-latin-regular-YtgfLPRn.woff2
vendored
Normal file
Binary file not shown.
18
canvas-demo/dist/index.html
vendored
Normal file
18
canvas-demo/dist/index.html
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<title>@blinksgg/canvas Demo</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
html, body, #root { width: 100%; height: 100%; overflow: hidden; }
|
||||
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
|
||||
</style>
|
||||
<script type="module" crossorigin src="/assets/index-B9jgFSpQ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BbLtK4h-.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
17
canvas-demo/index.html
Normal file
17
canvas-demo/index.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<title>@blinksgg/canvas Demo</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
html, body, #root { width: 100%; height: 100%; overflow: hidden; }
|
||||
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
21
canvas-demo/node_modules/.bin/tsc
generated
vendored
Executable file
21
canvas-demo/node_modules/.bin/tsc
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/node_modules"
|
||||
else
|
||||
export NODE_PATH="/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/node_modules:$NODE_PATH"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
||||
else
|
||||
exec node "$basedir/../typescript/bin/tsc" "$@"
|
||||
fi
|
||||
21
canvas-demo/node_modules/.bin/tsserver
generated
vendored
Executable file
21
canvas-demo/node_modules/.bin/tsserver
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/node_modules"
|
||||
else
|
||||
export NODE_PATH="/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/node_modules:$NODE_PATH"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
||||
else
|
||||
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
||||
fi
|
||||
21
canvas-demo/node_modules/.bin/vite
generated
vendored
Executable file
21
canvas-demo/node_modules/.bin/vite
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/vite@6.4.1_@types+node@24.10.4_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/vite@6.4.1_@types+node@24.10.4_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/vite@6.4.1_@types+node@24.10.4_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/node_modules"
|
||||
else
|
||||
export NODE_PATH="/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/vite@6.4.1_@types+node@24.10.4_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/vite@6.4.1_@types+node@24.10.4_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/vite@6.4.1_@types+node@24.10.4_jiti@2.6.1_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules:/home/amir/code/blinksgg/gg-antifragile/node_modules/.pnpm/node_modules:$NODE_PATH"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../vite/bin/vite.js" "$@"
|
||||
fi
|
||||
8359
canvas-demo/node_modules/.vite/deps/@blocknote_core_locales.js
generated
vendored
Normal file
8359
canvas-demo/node_modules/.vite/deps/@blocknote_core_locales.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/@blocknote_core_locales.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/@blocknote_core_locales.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
275
canvas-demo/node_modules/.vite/deps/@blocknote_react.js
generated
vendored
Normal file
275
canvas-demo/node_modules/.vite/deps/@blocknote_react.js
generated
vendored
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
import {
|
||||
$i,
|
||||
$r,
|
||||
Ai,
|
||||
Al,
|
||||
Ar,
|
||||
Be,
|
||||
Bl,
|
||||
Br,
|
||||
Bt,
|
||||
Cr,
|
||||
Ct,
|
||||
Di,
|
||||
Dl,
|
||||
Dr,
|
||||
E,
|
||||
Ei,
|
||||
El,
|
||||
Er,
|
||||
Et,
|
||||
Fi,
|
||||
Fl,
|
||||
Fr,
|
||||
Gl,
|
||||
Gr,
|
||||
Hi,
|
||||
Hr,
|
||||
Ii,
|
||||
Je,
|
||||
Jr,
|
||||
Ke,
|
||||
Kr,
|
||||
Le,
|
||||
Li,
|
||||
Ll,
|
||||
Lr,
|
||||
M,
|
||||
Ml,
|
||||
Ni,
|
||||
Nl,
|
||||
Oe,
|
||||
Oi,
|
||||
Ol,
|
||||
Or,
|
||||
Pi,
|
||||
Pr,
|
||||
Qi,
|
||||
Qt,
|
||||
R,
|
||||
Ri,
|
||||
Rl,
|
||||
Rr,
|
||||
Se,
|
||||
Sl,
|
||||
Sr,
|
||||
T,
|
||||
Tl,
|
||||
U,
|
||||
Ue,
|
||||
Ui,
|
||||
Ul,
|
||||
Ur,
|
||||
Vl,
|
||||
Vr,
|
||||
We,
|
||||
Wt,
|
||||
Xe,
|
||||
Xr,
|
||||
Xt,
|
||||
Yt,
|
||||
Zi,
|
||||
Zl,
|
||||
Zr,
|
||||
_l,
|
||||
_r,
|
||||
_t,
|
||||
ao,
|
||||
ar,
|
||||
bi,
|
||||
br,
|
||||
ci,
|
||||
cl,
|
||||
co,
|
||||
de,
|
||||
dr,
|
||||
ei,
|
||||
en,
|
||||
fi,
|
||||
fr,
|
||||
gi,
|
||||
gr,
|
||||
hi,
|
||||
hr,
|
||||
ht,
|
||||
il,
|
||||
ji,
|
||||
jl,
|
||||
jr,
|
||||
ki,
|
||||
kr,
|
||||
li,
|
||||
lo,
|
||||
mi,
|
||||
mr,
|
||||
nl,
|
||||
nn,
|
||||
oi,
|
||||
ol,
|
||||
pi,
|
||||
pr,
|
||||
q,
|
||||
qe,
|
||||
qr,
|
||||
qt,
|
||||
ri,
|
||||
rl,
|
||||
so,
|
||||
ti,
|
||||
tn,
|
||||
ui,
|
||||
uo,
|
||||
ur,
|
||||
v,
|
||||
vr,
|
||||
w,
|
||||
wi,
|
||||
wr,
|
||||
xi,
|
||||
xr,
|
||||
ye,
|
||||
yl,
|
||||
zl,
|
||||
zr
|
||||
} from "./chunk-PT7F464S.js";
|
||||
import "./chunk-DZXNXIW7.js";
|
||||
import "./chunk-RU4TY2CQ.js";
|
||||
import "./chunk-5QTNICOS.js";
|
||||
import "./chunk-LRUX6XQC.js";
|
||||
import "./chunk-YAGB2RBV.js";
|
||||
import "./chunk-T3SJLYUH.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export {
|
||||
Pr as AddBlockButton,
|
||||
ht as AddButton,
|
||||
wr as AddCommentButton,
|
||||
vr as AddCommentButtonInner,
|
||||
Oi as AddFileButton,
|
||||
kr as AddTiptapCommentButton,
|
||||
Ai as AudioBlock,
|
||||
Pi as AudioPreview,
|
||||
Ni as AudioToExternalHTML,
|
||||
de as BasicTextStyleButton,
|
||||
Ar as BlockColorsItem,
|
||||
Le as BlockContentWrapper,
|
||||
_t as BlockNoteContext,
|
||||
wi as BlockNoteDefaultUI,
|
||||
Ei as BlockNoteViewEditor,
|
||||
yl as BlockNoteViewRaw,
|
||||
Bt as BlockPopover,
|
||||
Cr as BlockTypeSelect,
|
||||
fi as ColorPickerButton,
|
||||
ar as ColorStyleButton,
|
||||
nl as Comment,
|
||||
ol as Comments,
|
||||
lo as ComponentsContext,
|
||||
dr as CreateLinkButton,
|
||||
ci as DeleteButton,
|
||||
Er as DeleteLinkButton,
|
||||
zr as DragHandleButton,
|
||||
Gr as DragHandleMenu,
|
||||
Br as EditLinkButton,
|
||||
Wt as EditLinkMenuItems,
|
||||
co as EmbedTab,
|
||||
Bl as ExperimentalMobileFormattingToolbarController,
|
||||
li as ExtendButton,
|
||||
qe as FigureWithCaption,
|
||||
Ke as FileBlockWrapper,
|
||||
ur as FileCaptionButton,
|
||||
mr as FileDeleteButton,
|
||||
Hr as FileDownloadButton,
|
||||
Ii as FileNameWithIcon,
|
||||
Et as FilePanel,
|
||||
uo as FilePanelController,
|
||||
xr as FilePreviewButton,
|
||||
fr as FileRenameButton,
|
||||
hr as FileReplaceButton,
|
||||
rl as FloatingComposer,
|
||||
il as FloatingComposerController,
|
||||
cl as FloatingThreadController,
|
||||
qt as FormattingToolbar,
|
||||
_r as FormattingToolbarController,
|
||||
U as GenericPopover,
|
||||
Xr as GridSuggestionMenuController,
|
||||
Kr as GridSuggestionMenuWrapper,
|
||||
Fi as ImageBlock,
|
||||
Zi as ImagePreview,
|
||||
Di as ImageToExternalHTML,
|
||||
Oe as InlineContentWrapper,
|
||||
Rr as LinkToolbar,
|
||||
Or as LinkToolbarController,
|
||||
Se as LinkWithCaption,
|
||||
gr as NestBlockButton,
|
||||
Lr as OpenLinkButton,
|
||||
Ue as PositionPopover,
|
||||
Sl as ReactAudioBlock,
|
||||
Ml as ReactFileBlock,
|
||||
Vl as ReactImageBlock,
|
||||
_l as ReactVideoBlock,
|
||||
Zr as RemoveBlockItem,
|
||||
en as ResizableFileBlockWrapper,
|
||||
Ur as SideMenu,
|
||||
jr as SideMenuController,
|
||||
hi as SplitButton,
|
||||
ri as SuggestionMenuController,
|
||||
ti as SuggestionMenuWrapper,
|
||||
bi as TableCellButton,
|
||||
gi as TableCellMenu,
|
||||
Sr as TableCellMergeButton,
|
||||
Ll as TableCellPopover,
|
||||
Fr as TableColumnHeaderItem,
|
||||
mi as TableHandle,
|
||||
ui as TableHandleMenu,
|
||||
pi as TableHandlesController,
|
||||
Dr as TableRowHeaderItem,
|
||||
Be as TextAlignButton,
|
||||
tn as Thread,
|
||||
Nl as ThreadsSidebar,
|
||||
El as ToggleWrapper,
|
||||
br as UnnestBlockButton,
|
||||
ao as UploadTab,
|
||||
$i as VideoBlock,
|
||||
Ui as VideoPreview,
|
||||
ji as VideoToExternalHTML,
|
||||
pr as blockTypeSelectItems,
|
||||
ye as createReactBlockSpec,
|
||||
Gl as createReactInlineContentSpec,
|
||||
zl as createReactStyleSpec,
|
||||
Ul as elementOverflow,
|
||||
$r as getDefaultReactEmojiPickerItems,
|
||||
oi as getDefaultReactSlashMenuItems,
|
||||
Vr as getFormattingToolbarItems,
|
||||
so as getMountedBoundingClientRectCache,
|
||||
Tl as getPageBreakReactSlashMenuItems,
|
||||
Ct as getReferenceText,
|
||||
jl as mergeRefs,
|
||||
Al as useActiveStyles,
|
||||
q as useBlockNoteContext,
|
||||
v as useBlockNoteEditor,
|
||||
Xt as useCloseSuggestionMenuNoItems,
|
||||
w as useComponentsContext,
|
||||
Xe as useCreateBlockNote,
|
||||
M as useDictionary,
|
||||
ki as useEditorChange,
|
||||
Zl as useEditorSelectionBoundingBox,
|
||||
Hi as useEditorSelectionChange,
|
||||
R as useEditorState,
|
||||
Rl as useExtendButtonsPositioning,
|
||||
T as useExtension,
|
||||
E as useExtensionState,
|
||||
Dl as useFocusWithin,
|
||||
qr as useGridSuggestionMenuKeyboardNavigation,
|
||||
Yt as useLoadSuggestionMenuItems,
|
||||
Li as useOnUploadEnd,
|
||||
Ri as useOnUploadStart,
|
||||
xi as usePrefersColorScheme,
|
||||
We as useResolveUrl,
|
||||
Fl as useSelectedBlocks,
|
||||
Jr as useSuggestionMenuKeyboardHandler,
|
||||
ei as useSuggestionMenuKeyboardNavigation,
|
||||
Ol as useTableHandlesPositioning,
|
||||
nn as useThreads,
|
||||
Qt as useUploadLoading,
|
||||
Qi as useUser,
|
||||
Je as useUsers
|
||||
};
|
||||
7
canvas-demo/node_modules/.vite/deps/@blocknote_react.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/@blocknote_react.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
31908
canvas-demo/node_modules/.vite/deps/@blocknote_shadcn.js
generated
vendored
Normal file
31908
canvas-demo/node_modules/.vite/deps/@blocknote_shadcn.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/@blocknote_shadcn.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/@blocknote_shadcn.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
16
canvas-demo/node_modules/.vite/deps/@radix-ui_react-slot.js
generated
vendored
Normal file
16
canvas-demo/node_modules/.vite/deps/@radix-ui_react-slot.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import {
|
||||
Slot,
|
||||
Slottable,
|
||||
createSlot,
|
||||
createSlottable
|
||||
} from "./chunk-KLRFSZSC.js";
|
||||
import "./chunk-YAGB2RBV.js";
|
||||
import "./chunk-T3SJLYUH.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export {
|
||||
Slot as Root,
|
||||
Slot,
|
||||
Slottable,
|
||||
createSlot,
|
||||
createSlottable
|
||||
};
|
||||
7
canvas-demo/node_modules/.vite/deps/@radix-ui_react-slot.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/@radix-ui_react-slot.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
12674
canvas-demo/node_modules/.vite/deps/@supabase_supabase-js.js
generated
vendored
Normal file
12674
canvas-demo/node_modules/.vite/deps/@supabase_supabase-js.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/@supabase_supabase-js.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/@supabase_supabase-js.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3665
canvas-demo/node_modules/.vite/deps/@tanstack_react-query.js
generated
vendored
Normal file
3665
canvas-demo/node_modules/.vite/deps/@tanstack_react-query.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/@tanstack_react-query.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/@tanstack_react-query.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1920
canvas-demo/node_modules/.vite/deps/@use-gesture_react.js
generated
vendored
Normal file
1920
canvas-demo/node_modules/.vite/deps/@use-gesture_react.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/@use-gesture_react.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/@use-gesture_react.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
181
canvas-demo/node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
181
canvas-demo/node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
{
|
||||
"hash": "1a11f247",
|
||||
"configHash": "8191b904",
|
||||
"lockfileHash": "f629c2fe",
|
||||
"browserHash": "16123507",
|
||||
"optimized": {
|
||||
"react": {
|
||||
"src": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js",
|
||||
"file": "react.js",
|
||||
"fileHash": "df6c8411",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react-dom": {
|
||||
"src": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js",
|
||||
"file": "react-dom.js",
|
||||
"fileHash": "d00b5c0a",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react/jsx-dev-runtime": {
|
||||
"src": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-dev-runtime.js",
|
||||
"file": "react_jsx-dev-runtime.js",
|
||||
"fileHash": "08c673b0",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react/jsx-runtime": {
|
||||
"src": "../../../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js",
|
||||
"file": "react_jsx-runtime.js",
|
||||
"fileHash": "7c88cf7c",
|
||||
"needsInterop": true
|
||||
},
|
||||
"@blocknote/core/locales": {
|
||||
"src": "../../../../../node_modules/.pnpm/@blocknote+core@0.45.0_@tiptap+extensions@3.14.0_@tiptap+core@3.14.0_@tiptap+pm@3.14.0__f23d443be271153d169671d52d4cc932/node_modules/@blocknote/core/dist/locales.js",
|
||||
"file": "@blocknote_core_locales.js",
|
||||
"fileHash": "c66190ba",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@blocknote/react": {
|
||||
"src": "../../../../../node_modules/.pnpm/@blocknote+react@0.45.0_@floating-ui+dom@1.7.4_@tiptap+extensions@3.14.0_@tiptap+core@3_4c2381f288dfb667bae932edc4edea17/node_modules/@blocknote/react/dist/blocknote-react.js",
|
||||
"file": "@blocknote_react.js",
|
||||
"fileHash": "9791ac85",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@blocknote/shadcn": {
|
||||
"src": "../../../../../node_modules/.pnpm/@blocknote+shadcn@0.45.0_@floating-ui+dom@1.7.4_@tiptap+extensions@3.14.0_@tiptap+core@_ffb4794918886c8a19c364f2fbd1458d/node_modules/@blocknote/shadcn/dist/blocknote-shadcn.js",
|
||||
"file": "@blocknote_shadcn.js",
|
||||
"fileHash": "0f4fe6f1",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@radix-ui/react-slot": {
|
||||
"src": "../../../../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.7_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs",
|
||||
"file": "@radix-ui_react-slot.js",
|
||||
"fileHash": "d6c75bba",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@supabase/supabase-js": {
|
||||
"src": "../../../../../node_modules/.pnpm/@supabase+supabase-js@2.86.2_bufferutil@4.1.0_utf-8-validate@5.0.10/node_modules/@supabase/supabase-js/dist/esm/wrapper.mjs",
|
||||
"file": "@supabase_supabase-js.js",
|
||||
"fileHash": "7564d109",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@tanstack/react-query": {
|
||||
"src": "../../../../../node_modules/.pnpm/@tanstack+react-query@5.90.12_react@19.2.3/node_modules/@tanstack/react-query/build/modern/index.js",
|
||||
"file": "@tanstack_react-query.js",
|
||||
"fileHash": "5a0c1908",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@use-gesture/react": {
|
||||
"src": "../../../../../node_modules/.pnpm/@use-gesture+react@10.3.1_react@19.2.3/node_modules/@use-gesture/react/dist/use-gesture-react.esm.js",
|
||||
"file": "@use-gesture_react.js",
|
||||
"fileHash": "d8d64290",
|
||||
"needsInterop": false
|
||||
},
|
||||
"class-variance-authority": {
|
||||
"src": "../../../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs",
|
||||
"file": "class-variance-authority.js",
|
||||
"fileHash": "0c881cea",
|
||||
"needsInterop": false
|
||||
},
|
||||
"clsx": {
|
||||
"src": "../../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs",
|
||||
"file": "clsx.js",
|
||||
"fileHash": "c0d294c9",
|
||||
"needsInterop": false
|
||||
},
|
||||
"d3-force": {
|
||||
"src": "../../../../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/index.js",
|
||||
"file": "d3-force.js",
|
||||
"fileHash": "03b8227a",
|
||||
"needsInterop": false
|
||||
},
|
||||
"debug": {
|
||||
"src": "../../../../../node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js",
|
||||
"file": "debug.js",
|
||||
"fileHash": "64be1aed",
|
||||
"needsInterop": true
|
||||
},
|
||||
"graphology": {
|
||||
"src": "../../../../../node_modules/.pnpm/graphology@0.26.0_graphology-types@0.24.8/node_modules/graphology/dist/graphology.mjs",
|
||||
"file": "graphology.js",
|
||||
"fileHash": "2824eb05",
|
||||
"needsInterop": false
|
||||
},
|
||||
"jotai": {
|
||||
"src": "../../../../../node_modules/.pnpm/jotai@2.16.0_@babel+core@7.28.5_@babel+template@7.27.2_@types+react@19.2.7_react@19.2.3/node_modules/jotai/esm/index.mjs",
|
||||
"file": "jotai.js",
|
||||
"fileHash": "e1047fa5",
|
||||
"needsInterop": false
|
||||
},
|
||||
"jotai/utils": {
|
||||
"src": "../../../../../node_modules/.pnpm/jotai@2.16.0_@babel+core@7.28.5_@babel+template@7.27.2_@types+react@19.2.7_react@19.2.3/node_modules/jotai/esm/utils.mjs",
|
||||
"file": "jotai_utils.js",
|
||||
"fileHash": "6c309f8c",
|
||||
"needsInterop": false
|
||||
},
|
||||
"lucide-react": {
|
||||
"src": "../../../../../node_modules/.pnpm/lucide-react@0.576.0_react@19.2.3/node_modules/lucide-react/dist/esm/lucide-react.js",
|
||||
"file": "lucide-react.js",
|
||||
"fileHash": "84f36484",
|
||||
"needsInterop": false
|
||||
},
|
||||
"react-dom/client": {
|
||||
"src": "../../../../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/client.js",
|
||||
"file": "react-dom_client.js",
|
||||
"fileHash": "5b046efa",
|
||||
"needsInterop": true
|
||||
},
|
||||
"tailwind-merge": {
|
||||
"src": "../../../../../node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs",
|
||||
"file": "tailwind-merge.js",
|
||||
"fileHash": "dfa13343",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
"chunks": {
|
||||
"module-4GIHSJCO": {
|
||||
"file": "module-4GIHSJCO.js"
|
||||
},
|
||||
"native-JYCSL3WK": {
|
||||
"file": "native-JYCSL3WK.js"
|
||||
},
|
||||
"chunk-5DYWO4C6": {
|
||||
"file": "chunk-5DYWO4C6.js"
|
||||
},
|
||||
"chunk-SIU35MPB": {
|
||||
"file": "chunk-SIU35MPB.js"
|
||||
},
|
||||
"chunk-PT7F464S": {
|
||||
"file": "chunk-PT7F464S.js"
|
||||
},
|
||||
"chunk-DZXNXIW7": {
|
||||
"file": "chunk-DZXNXIW7.js"
|
||||
},
|
||||
"chunk-RU4TY2CQ": {
|
||||
"file": "chunk-RU4TY2CQ.js"
|
||||
},
|
||||
"chunk-5QTNICOS": {
|
||||
"file": "chunk-5QTNICOS.js"
|
||||
},
|
||||
"chunk-HZEBPUXZ": {
|
||||
"file": "chunk-HZEBPUXZ.js"
|
||||
},
|
||||
"chunk-LRUX6XQC": {
|
||||
"file": "chunk-LRUX6XQC.js"
|
||||
},
|
||||
"chunk-KLRFSZSC": {
|
||||
"file": "chunk-KLRFSZSC.js"
|
||||
},
|
||||
"chunk-YAGB2RBV": {
|
||||
"file": "chunk-YAGB2RBV.js"
|
||||
},
|
||||
"chunk-T3SJLYUH": {
|
||||
"file": "chunk-T3SJLYUH.js"
|
||||
},
|
||||
"chunk-B3JW6XJO": {
|
||||
"file": "chunk-B3JW6XJO.js"
|
||||
},
|
||||
"chunk-4B2QHNJT": {
|
||||
"file": "chunk-4B2QHNJT.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
65
canvas-demo/node_modules/.vite/deps/chunk-4B2QHNJT.js
generated
vendored
Normal file
65
canvas-demo/node_modules/.vite/deps/chunk-4B2QHNJT.js
generated
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __typeError = (msg) => {
|
||||
throw TypeError(msg);
|
||||
};
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __esm = (fn, res) => function __init() {
|
||||
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
||||
};
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
||||
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
||||
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
||||
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
||||
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
||||
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
||||
var __privateWrapper = (obj, member, setter, getter) => ({
|
||||
set _(value) {
|
||||
__privateSet(obj, member, value, setter);
|
||||
},
|
||||
get _() {
|
||||
return __privateGet(obj, member, getter);
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
__esm,
|
||||
__commonJS,
|
||||
__export,
|
||||
__toESM,
|
||||
__toCommonJS,
|
||||
__publicField,
|
||||
__privateGet,
|
||||
__privateAdd,
|
||||
__privateSet,
|
||||
__privateMethod,
|
||||
__privateWrapper
|
||||
};
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-4B2QHNJT.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-4B2QHNJT.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
51
canvas-demo/node_modules/.vite/deps/chunk-5DYWO4C6.js
generated
vendored
Normal file
51
canvas-demo/node_modules/.vite/deps/chunk-5DYWO4C6.js
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import {
|
||||
clsx
|
||||
} from "./chunk-SIU35MPB.js";
|
||||
|
||||
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
||||
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
||||
var cx = clsx;
|
||||
var cva = (base, config) => (props) => {
|
||||
var _config_compoundVariants;
|
||||
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
||||
const { variants, defaultVariants } = config;
|
||||
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
||||
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
||||
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
||||
if (variantProp === null) return null;
|
||||
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
||||
return variants[variant][variantKey];
|
||||
});
|
||||
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
||||
let [key, value] = param;
|
||||
if (value === void 0) {
|
||||
return acc;
|
||||
}
|
||||
acc[key] = value;
|
||||
return acc;
|
||||
}, {});
|
||||
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
||||
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
||||
return Object.entries(compoundVariantOptions).every((param2) => {
|
||||
let [key, value] = param2;
|
||||
return Array.isArray(value) ? value.includes({
|
||||
...defaultVariants,
|
||||
...propsWithoutUndefined
|
||||
}[key]) : {
|
||||
...defaultVariants,
|
||||
...propsWithoutUndefined
|
||||
}[key] === value;
|
||||
}) ? [
|
||||
...acc,
|
||||
cvClass,
|
||||
cvClassName
|
||||
] : acc;
|
||||
}, []);
|
||||
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
||||
};
|
||||
|
||||
export {
|
||||
cx,
|
||||
cva
|
||||
};
|
||||
//# sourceMappingURL=chunk-5DYWO4C6.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-5DYWO4C6.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-5DYWO4C6.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs"],
|
||||
"sourcesContent": ["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n"],
|
||||
"mappings": ";;;;;AAeA,IAAM,gBAAgB,CAAC,UAAQ,OAAO,UAAU,YAAY,GAAG,KAAK,KAAK,UAAU,IAAI,MAAM;AACtF,IAAM,KAAK;AACX,IAAM,MAAM,CAAC,MAAM,WAAS,CAAC,UAAQ;AACpC,MAAI;AACJ,OAAK,WAAW,QAAQ,WAAW,SAAS,SAAS,OAAO,aAAa,KAAM,QAAO,GAAG,MAAM,UAAU,QAAQ,UAAU,SAAS,SAAS,MAAM,OAAO,UAAU,QAAQ,UAAU,SAAS,SAAS,MAAM,SAAS;AACvN,QAAM,EAAE,UAAU,gBAAgB,IAAI;AACtC,QAAM,uBAAuB,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,YAAU;AAC9D,UAAM,cAAc,UAAU,QAAQ,UAAU,SAAS,SAAS,MAAM,OAAO;AAC/E,UAAM,qBAAqB,oBAAoB,QAAQ,oBAAoB,SAAS,SAAS,gBAAgB,OAAO;AACpH,QAAI,gBAAgB,KAAM,QAAO;AACjC,UAAM,aAAa,cAAc,WAAW,KAAK,cAAc,kBAAkB;AACjF,WAAO,SAAS,OAAO,EAAE,UAAU;AAAA,EACvC,CAAC;AACD,QAAM,wBAAwB,SAAS,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,KAAK,UAAQ;AAC9E,QAAI,CAAC,KAAK,KAAK,IAAI;AACnB,QAAI,UAAU,QAAW;AACrB,aAAO;AAAA,IACX;AACA,QAAI,GAAG,IAAI;AACX,WAAO;AAAA,EACX,GAAG,CAAC,CAAC;AACL,QAAM,+BAA+B,WAAW,QAAQ,WAAW,SAAS,UAAU,2BAA2B,OAAO,sBAAsB,QAAQ,6BAA6B,SAAS,SAAS,yBAAyB,OAAO,CAAC,KAAK,UAAQ;AAC/O,QAAI,EAAE,OAAO,SAAS,WAAW,aAAa,GAAG,uBAAuB,IAAI;AAC5E,WAAO,OAAO,QAAQ,sBAAsB,EAAE,MAAM,CAACA,WAAQ;AACzD,UAAI,CAAC,KAAK,KAAK,IAAIA;AACnB,aAAO,MAAM,QAAQ,KAAK,IAAI,MAAM,SAAS;AAAA,QACzC,GAAG;AAAA,QACH,GAAG;AAAA,MACP,EAAE,GAAG,CAAC,IAAK;AAAA,QACP,GAAG;AAAA,QACH,GAAG;AAAA,MACP,EAAG,GAAG,MAAM;AAAA,IAChB,CAAC,IAAI;AAAA,MACD,GAAG;AAAA,MACH;AAAA,MACA;AAAA,IACJ,IAAI;AAAA,EACR,GAAG,CAAC,CAAC;AACL,SAAO,GAAG,MAAM,sBAAsB,8BAA8B,UAAU,QAAQ,UAAU,SAAS,SAAS,MAAM,OAAO,UAAU,QAAQ,UAAU,SAAS,SAAS,MAAM,SAAS;AAChM;",
|
||||
"names": ["param"]
|
||||
}
|
||||
471
canvas-demo/node_modules/.vite/deps/chunk-5QTNICOS.js
generated
vendored
Normal file
471
canvas-demo/node_modules/.vite/deps/chunk-5QTNICOS.js
generated
vendored
Normal file
|
|
@ -0,0 +1,471 @@
|
|||
import {
|
||||
__commonJS
|
||||
} from "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
|
||||
var require_ms = __commonJS({
|
||||
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
|
||||
var s = 1e3;
|
||||
var m = s * 60;
|
||||
var h = m * 60;
|
||||
var d = h * 24;
|
||||
var w = d * 7;
|
||||
var y = d * 365.25;
|
||||
module.exports = function(val, options) {
|
||||
options = options || {};
|
||||
var type = typeof val;
|
||||
if (type === "string" && val.length > 0) {
|
||||
return parse(val);
|
||||
} else if (type === "number" && isFinite(val)) {
|
||||
return options.long ? fmtLong(val) : fmtShort(val);
|
||||
}
|
||||
throw new Error(
|
||||
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
||||
);
|
||||
};
|
||||
function parse(str) {
|
||||
str = String(str);
|
||||
if (str.length > 100) {
|
||||
return;
|
||||
}
|
||||
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
||||
str
|
||||
);
|
||||
if (!match) {
|
||||
return;
|
||||
}
|
||||
var n = parseFloat(match[1]);
|
||||
var type = (match[2] || "ms").toLowerCase();
|
||||
switch (type) {
|
||||
case "years":
|
||||
case "year":
|
||||
case "yrs":
|
||||
case "yr":
|
||||
case "y":
|
||||
return n * y;
|
||||
case "weeks":
|
||||
case "week":
|
||||
case "w":
|
||||
return n * w;
|
||||
case "days":
|
||||
case "day":
|
||||
case "d":
|
||||
return n * d;
|
||||
case "hours":
|
||||
case "hour":
|
||||
case "hrs":
|
||||
case "hr":
|
||||
case "h":
|
||||
return n * h;
|
||||
case "minutes":
|
||||
case "minute":
|
||||
case "mins":
|
||||
case "min":
|
||||
case "m":
|
||||
return n * m;
|
||||
case "seconds":
|
||||
case "second":
|
||||
case "secs":
|
||||
case "sec":
|
||||
case "s":
|
||||
return n * s;
|
||||
case "milliseconds":
|
||||
case "millisecond":
|
||||
case "msecs":
|
||||
case "msec":
|
||||
case "ms":
|
||||
return n;
|
||||
default:
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
function fmtShort(ms) {
|
||||
var msAbs = Math.abs(ms);
|
||||
if (msAbs >= d) {
|
||||
return Math.round(ms / d) + "d";
|
||||
}
|
||||
if (msAbs >= h) {
|
||||
return Math.round(ms / h) + "h";
|
||||
}
|
||||
if (msAbs >= m) {
|
||||
return Math.round(ms / m) + "m";
|
||||
}
|
||||
if (msAbs >= s) {
|
||||
return Math.round(ms / s) + "s";
|
||||
}
|
||||
return ms + "ms";
|
||||
}
|
||||
function fmtLong(ms) {
|
||||
var msAbs = Math.abs(ms);
|
||||
if (msAbs >= d) {
|
||||
return plural(ms, msAbs, d, "day");
|
||||
}
|
||||
if (msAbs >= h) {
|
||||
return plural(ms, msAbs, h, "hour");
|
||||
}
|
||||
if (msAbs >= m) {
|
||||
return plural(ms, msAbs, m, "minute");
|
||||
}
|
||||
if (msAbs >= s) {
|
||||
return plural(ms, msAbs, s, "second");
|
||||
}
|
||||
return ms + " ms";
|
||||
}
|
||||
function plural(ms, msAbs, n, name) {
|
||||
var isPlural = msAbs >= n * 1.5;
|
||||
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ../../node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js
|
||||
var require_common = __commonJS({
|
||||
"../../node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js"(exports, module) {
|
||||
function setup(env) {
|
||||
createDebug.debug = createDebug;
|
||||
createDebug.default = createDebug;
|
||||
createDebug.coerce = coerce;
|
||||
createDebug.disable = disable;
|
||||
createDebug.enable = enable;
|
||||
createDebug.enabled = enabled;
|
||||
createDebug.humanize = require_ms();
|
||||
createDebug.destroy = destroy;
|
||||
Object.keys(env).forEach((key) => {
|
||||
createDebug[key] = env[key];
|
||||
});
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
createDebug.formatters = {};
|
||||
function selectColor(namespace) {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < namespace.length; i++) {
|
||||
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
||||
hash |= 0;
|
||||
}
|
||||
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
||||
}
|
||||
createDebug.selectColor = selectColor;
|
||||
function createDebug(namespace) {
|
||||
let prevTime;
|
||||
let enableOverride = null;
|
||||
let namespacesCache;
|
||||
let enabledCache;
|
||||
function debug(...args) {
|
||||
if (!debug.enabled) {
|
||||
return;
|
||||
}
|
||||
const self = debug;
|
||||
const curr = Number(/* @__PURE__ */ new Date());
|
||||
const ms = curr - (prevTime || curr);
|
||||
self.diff = ms;
|
||||
self.prev = prevTime;
|
||||
self.curr = curr;
|
||||
prevTime = curr;
|
||||
args[0] = createDebug.coerce(args[0]);
|
||||
if (typeof args[0] !== "string") {
|
||||
args.unshift("%O");
|
||||
}
|
||||
let index = 0;
|
||||
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
||||
if (match === "%%") {
|
||||
return "%";
|
||||
}
|
||||
index++;
|
||||
const formatter = createDebug.formatters[format];
|
||||
if (typeof formatter === "function") {
|
||||
const val = args[index];
|
||||
match = formatter.call(self, val);
|
||||
args.splice(index, 1);
|
||||
index--;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
createDebug.formatArgs.call(self, args);
|
||||
const logFn = self.log || createDebug.log;
|
||||
logFn.apply(self, args);
|
||||
}
|
||||
debug.namespace = namespace;
|
||||
debug.useColors = createDebug.useColors();
|
||||
debug.color = createDebug.selectColor(namespace);
|
||||
debug.extend = extend;
|
||||
debug.destroy = createDebug.destroy;
|
||||
Object.defineProperty(debug, "enabled", {
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
get: () => {
|
||||
if (enableOverride !== null) {
|
||||
return enableOverride;
|
||||
}
|
||||
if (namespacesCache !== createDebug.namespaces) {
|
||||
namespacesCache = createDebug.namespaces;
|
||||
enabledCache = createDebug.enabled(namespace);
|
||||
}
|
||||
return enabledCache;
|
||||
},
|
||||
set: (v) => {
|
||||
enableOverride = v;
|
||||
}
|
||||
});
|
||||
if (typeof createDebug.init === "function") {
|
||||
createDebug.init(debug);
|
||||
}
|
||||
return debug;
|
||||
}
|
||||
function extend(namespace, delimiter) {
|
||||
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
||||
newDebug.log = this.log;
|
||||
return newDebug;
|
||||
}
|
||||
function enable(namespaces) {
|
||||
createDebug.save(namespaces);
|
||||
createDebug.namespaces = namespaces;
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
||||
for (const ns of split) {
|
||||
if (ns[0] === "-") {
|
||||
createDebug.skips.push(ns.slice(1));
|
||||
} else {
|
||||
createDebug.names.push(ns);
|
||||
}
|
||||
}
|
||||
}
|
||||
function matchesTemplate(search, template) {
|
||||
let searchIndex = 0;
|
||||
let templateIndex = 0;
|
||||
let starIndex = -1;
|
||||
let matchIndex = 0;
|
||||
while (searchIndex < search.length) {
|
||||
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
||||
if (template[templateIndex] === "*") {
|
||||
starIndex = templateIndex;
|
||||
matchIndex = searchIndex;
|
||||
templateIndex++;
|
||||
} else {
|
||||
searchIndex++;
|
||||
templateIndex++;
|
||||
}
|
||||
} else if (starIndex !== -1) {
|
||||
templateIndex = starIndex + 1;
|
||||
matchIndex++;
|
||||
searchIndex = matchIndex;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
while (templateIndex < template.length && template[templateIndex] === "*") {
|
||||
templateIndex++;
|
||||
}
|
||||
return templateIndex === template.length;
|
||||
}
|
||||
function disable() {
|
||||
const namespaces = [
|
||||
...createDebug.names,
|
||||
...createDebug.skips.map((namespace) => "-" + namespace)
|
||||
].join(",");
|
||||
createDebug.enable("");
|
||||
return namespaces;
|
||||
}
|
||||
function enabled(name) {
|
||||
for (const skip of createDebug.skips) {
|
||||
if (matchesTemplate(name, skip)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (const ns of createDebug.names) {
|
||||
if (matchesTemplate(name, ns)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function coerce(val) {
|
||||
if (val instanceof Error) {
|
||||
return val.stack || val.message;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
function destroy() {
|
||||
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
||||
}
|
||||
createDebug.enable(createDebug.load());
|
||||
return createDebug;
|
||||
}
|
||||
module.exports = setup;
|
||||
}
|
||||
});
|
||||
|
||||
// ../../node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js
|
||||
var require_browser = __commonJS({
|
||||
"../../node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports, module) {
|
||||
exports.formatArgs = formatArgs;
|
||||
exports.save = save;
|
||||
exports.load = load;
|
||||
exports.useColors = useColors;
|
||||
exports.storage = localstorage();
|
||||
exports.destroy = /* @__PURE__ */ (() => {
|
||||
let warned = false;
|
||||
return () => {
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
||||
}
|
||||
};
|
||||
})();
|
||||
exports.colors = [
|
||||
"#0000CC",
|
||||
"#0000FF",
|
||||
"#0033CC",
|
||||
"#0033FF",
|
||||
"#0066CC",
|
||||
"#0066FF",
|
||||
"#0099CC",
|
||||
"#0099FF",
|
||||
"#00CC00",
|
||||
"#00CC33",
|
||||
"#00CC66",
|
||||
"#00CC99",
|
||||
"#00CCCC",
|
||||
"#00CCFF",
|
||||
"#3300CC",
|
||||
"#3300FF",
|
||||
"#3333CC",
|
||||
"#3333FF",
|
||||
"#3366CC",
|
||||
"#3366FF",
|
||||
"#3399CC",
|
||||
"#3399FF",
|
||||
"#33CC00",
|
||||
"#33CC33",
|
||||
"#33CC66",
|
||||
"#33CC99",
|
||||
"#33CCCC",
|
||||
"#33CCFF",
|
||||
"#6600CC",
|
||||
"#6600FF",
|
||||
"#6633CC",
|
||||
"#6633FF",
|
||||
"#66CC00",
|
||||
"#66CC33",
|
||||
"#9900CC",
|
||||
"#9900FF",
|
||||
"#9933CC",
|
||||
"#9933FF",
|
||||
"#99CC00",
|
||||
"#99CC33",
|
||||
"#CC0000",
|
||||
"#CC0033",
|
||||
"#CC0066",
|
||||
"#CC0099",
|
||||
"#CC00CC",
|
||||
"#CC00FF",
|
||||
"#CC3300",
|
||||
"#CC3333",
|
||||
"#CC3366",
|
||||
"#CC3399",
|
||||
"#CC33CC",
|
||||
"#CC33FF",
|
||||
"#CC6600",
|
||||
"#CC6633",
|
||||
"#CC9900",
|
||||
"#CC9933",
|
||||
"#CCCC00",
|
||||
"#CCCC33",
|
||||
"#FF0000",
|
||||
"#FF0033",
|
||||
"#FF0066",
|
||||
"#FF0099",
|
||||
"#FF00CC",
|
||||
"#FF00FF",
|
||||
"#FF3300",
|
||||
"#FF3333",
|
||||
"#FF3366",
|
||||
"#FF3399",
|
||||
"#FF33CC",
|
||||
"#FF33FF",
|
||||
"#FF6600",
|
||||
"#FF6633",
|
||||
"#FF9900",
|
||||
"#FF9933",
|
||||
"#FFCC00",
|
||||
"#FFCC33"
|
||||
];
|
||||
function useColors() {
|
||||
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
||||
return true;
|
||||
}
|
||||
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
||||
return false;
|
||||
}
|
||||
let m;
|
||||
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
||||
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
||||
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
||||
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
||||
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
||||
}
|
||||
function formatArgs(args) {
|
||||
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
||||
if (!this.useColors) {
|
||||
return;
|
||||
}
|
||||
const c = "color: " + this.color;
|
||||
args.splice(1, 0, c, "color: inherit");
|
||||
let index = 0;
|
||||
let lastC = 0;
|
||||
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
||||
if (match === "%%") {
|
||||
return;
|
||||
}
|
||||
index++;
|
||||
if (match === "%c") {
|
||||
lastC = index;
|
||||
}
|
||||
});
|
||||
args.splice(lastC, 0, c);
|
||||
}
|
||||
exports.log = console.debug || console.log || (() => {
|
||||
});
|
||||
function save(namespaces) {
|
||||
try {
|
||||
if (namespaces) {
|
||||
exports.storage.setItem("debug", namespaces);
|
||||
} else {
|
||||
exports.storage.removeItem("debug");
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
function load() {
|
||||
let r;
|
||||
try {
|
||||
r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
|
||||
} catch (error) {
|
||||
}
|
||||
if (!r && typeof process !== "undefined" && "env" in process) {
|
||||
r = process.env.DEBUG;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
function localstorage() {
|
||||
try {
|
||||
return localStorage;
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
module.exports = require_common()(exports);
|
||||
var { formatters } = module.exports;
|
||||
formatters.j = function(v) {
|
||||
try {
|
||||
return JSON.stringify(v);
|
||||
} catch (error) {
|
||||
return "[UnexpectedJSONParseError]: " + error.message;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
require_browser
|
||||
};
|
||||
//# sourceMappingURL=chunk-5QTNICOS.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-5QTNICOS.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-5QTNICOS.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
539
canvas-demo/node_modules/.vite/deps/chunk-B3JW6XJO.js
generated
vendored
Normal file
539
canvas-demo/node_modules/.vite/deps/chunk-B3JW6XJO.js
generated
vendored
Normal file
|
|
@ -0,0 +1,539 @@
|
|||
import {
|
||||
__esm,
|
||||
__export
|
||||
} from "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
|
||||
var tslib_es6_exports = {};
|
||||
__export(tslib_es6_exports, {
|
||||
__addDisposableResource: () => __addDisposableResource,
|
||||
__assign: () => __assign,
|
||||
__asyncDelegator: () => __asyncDelegator,
|
||||
__asyncGenerator: () => __asyncGenerator,
|
||||
__asyncValues: () => __asyncValues,
|
||||
__await: () => __await,
|
||||
__awaiter: () => __awaiter,
|
||||
__classPrivateFieldGet: () => __classPrivateFieldGet,
|
||||
__classPrivateFieldIn: () => __classPrivateFieldIn,
|
||||
__classPrivateFieldSet: () => __classPrivateFieldSet,
|
||||
__createBinding: () => __createBinding,
|
||||
__decorate: () => __decorate,
|
||||
__disposeResources: () => __disposeResources,
|
||||
__esDecorate: () => __esDecorate,
|
||||
__exportStar: () => __exportStar,
|
||||
__extends: () => __extends,
|
||||
__generator: () => __generator,
|
||||
__importDefault: () => __importDefault,
|
||||
__importStar: () => __importStar,
|
||||
__makeTemplateObject: () => __makeTemplateObject,
|
||||
__metadata: () => __metadata,
|
||||
__param: () => __param,
|
||||
__propKey: () => __propKey,
|
||||
__read: () => __read,
|
||||
__rest: () => __rest,
|
||||
__rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
|
||||
__runInitializers: () => __runInitializers,
|
||||
__setFunctionName: () => __setFunctionName,
|
||||
__spread: () => __spread,
|
||||
__spreadArray: () => __spreadArray,
|
||||
__spreadArrays: () => __spreadArrays,
|
||||
__values: () => __values,
|
||||
default: () => tslib_es6_default
|
||||
});
|
||||
function __extends(d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() {
|
||||
this.constructor = d;
|
||||
}
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
}
|
||||
function __rest(s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
function __param(paramIndex, decorator) {
|
||||
return function(target, key) {
|
||||
decorator(target, key, paramIndex);
|
||||
};
|
||||
}
|
||||
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
||||
function accept(f) {
|
||||
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
||||
return f;
|
||||
}
|
||||
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
||||
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
||||
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
||||
var _, done = false;
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var context = {};
|
||||
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
||||
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
||||
context.addInitializer = function(f) {
|
||||
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
||||
extraInitializers.push(accept(f || null));
|
||||
};
|
||||
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
||||
if (kind === "accessor") {
|
||||
if (result === void 0) continue;
|
||||
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
||||
if (_ = accept(result.get)) descriptor.get = _;
|
||||
if (_ = accept(result.set)) descriptor.set = _;
|
||||
if (_ = accept(result.init)) initializers.unshift(_);
|
||||
} else if (_ = accept(result)) {
|
||||
if (kind === "field") initializers.unshift(_);
|
||||
else descriptor[key] = _;
|
||||
}
|
||||
}
|
||||
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
||||
done = true;
|
||||
}
|
||||
function __runInitializers(thisArg, initializers, value) {
|
||||
var useValue = arguments.length > 2;
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
||||
}
|
||||
return useValue ? value : void 0;
|
||||
}
|
||||
function __propKey(x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
}
|
||||
function __setFunctionName(f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
}
|
||||
function __metadata(metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
}
|
||||
function __awaiter(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) {
|
||||
return value instanceof P ? value : new P(function(resolve) {
|
||||
resolve(value);
|
||||
});
|
||||
}
|
||||
return new (P || (P = Promise))(function(resolve, reject) {
|
||||
function fulfilled(value) {
|
||||
try {
|
||||
step(generator.next(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
}
|
||||
function rejected(value) {
|
||||
try {
|
||||
step(generator["throw"](value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
}
|
||||
function step(result) {
|
||||
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
||||
}
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
}
|
||||
function __generator(thisArg, body) {
|
||||
var _ = { label: 0, sent: function() {
|
||||
if (t[0] & 1) throw t[1];
|
||||
return t[1];
|
||||
}, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
||||
return this;
|
||||
}), g;
|
||||
function verb(n) {
|
||||
return function(v) {
|
||||
return step([n, v]);
|
||||
};
|
||||
}
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0:
|
||||
case 1:
|
||||
t = op;
|
||||
break;
|
||||
case 4:
|
||||
_.label++;
|
||||
return { value: op[1], done: false };
|
||||
case 5:
|
||||
_.label++;
|
||||
y = op[1];
|
||||
op = [0];
|
||||
continue;
|
||||
case 7:
|
||||
op = _.ops.pop();
|
||||
_.trys.pop();
|
||||
continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
||||
_ = 0;
|
||||
continue;
|
||||
}
|
||||
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
||||
_.label = op[1];
|
||||
break;
|
||||
}
|
||||
if (op[0] === 6 && _.label < t[1]) {
|
||||
_.label = t[1];
|
||||
t = op;
|
||||
break;
|
||||
}
|
||||
if (t && _.label < t[2]) {
|
||||
_.label = t[2];
|
||||
_.ops.push(op);
|
||||
break;
|
||||
}
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop();
|
||||
continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) {
|
||||
op = [6, e];
|
||||
y = 0;
|
||||
} finally {
|
||||
f = t = 0;
|
||||
}
|
||||
if (op[0] & 5) throw op[1];
|
||||
return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
}
|
||||
function __exportStar(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
}
|
||||
function __values(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function() {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
}
|
||||
function __read(o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
} catch (error) {
|
||||
e = { error };
|
||||
} finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
} finally {
|
||||
if (e) throw e.error;
|
||||
}
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
function __spread() {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
}
|
||||
function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
function __spreadArray(to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
}
|
||||
function __await(v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
}
|
||||
function __asyncGenerator(thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
||||
return this;
|
||||
}, i;
|
||||
function awaitReturn(f) {
|
||||
return function(v) {
|
||||
return Promise.resolve(v).then(f, reject);
|
||||
};
|
||||
}
|
||||
function verb(n, f) {
|
||||
if (g[n]) {
|
||||
i[n] = function(v) {
|
||||
return new Promise(function(a, b) {
|
||||
q.push([n, v, a, b]) > 1 || resume(n, v);
|
||||
});
|
||||
};
|
||||
if (f) i[n] = f(i[n]);
|
||||
}
|
||||
}
|
||||
function resume(n, v) {
|
||||
try {
|
||||
step(g[n](v));
|
||||
} catch (e) {
|
||||
settle(q[0][3], e);
|
||||
}
|
||||
}
|
||||
function step(r) {
|
||||
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
|
||||
}
|
||||
function fulfill(value) {
|
||||
resume("next", value);
|
||||
}
|
||||
function reject(value) {
|
||||
resume("throw", value);
|
||||
}
|
||||
function settle(f, v) {
|
||||
if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
|
||||
}
|
||||
}
|
||||
function __asyncDelegator(o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function(e) {
|
||||
throw e;
|
||||
}), verb("return"), i[Symbol.iterator] = function() {
|
||||
return this;
|
||||
}, i;
|
||||
function verb(n, f) {
|
||||
i[n] = o[n] ? function(v) {
|
||||
return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
|
||||
} : f;
|
||||
}
|
||||
}
|
||||
function __asyncValues(o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
||||
return this;
|
||||
}, i);
|
||||
function verb(n) {
|
||||
i[n] = o[n] && function(v) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
||||
});
|
||||
};
|
||||
}
|
||||
function settle(resolve, reject, d, v) {
|
||||
Promise.resolve(v).then(function(v2) {
|
||||
resolve({ value: v2, done: d });
|
||||
}, reject);
|
||||
}
|
||||
}
|
||||
function __makeTemplateObject(cooked, raw) {
|
||||
if (Object.defineProperty) {
|
||||
Object.defineProperty(cooked, "raw", { value: raw });
|
||||
} else {
|
||||
cooked.raw = raw;
|
||||
}
|
||||
return cooked;
|
||||
}
|
||||
function __importStar(mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) {
|
||||
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
}
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
}
|
||||
function __importDefault(mod) {
|
||||
return mod && mod.__esModule ? mod : { default: mod };
|
||||
}
|
||||
function __classPrivateFieldGet(receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
}
|
||||
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
||||
}
|
||||
function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
function __addDisposableResource(env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose, inner;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
if (async) inner = dispose;
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
if (inner) dispose = function() {
|
||||
try {
|
||||
inner.call(this);
|
||||
} catch (e) {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
};
|
||||
env.stack.push({ value, dispose, async });
|
||||
} else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function __disposeResources(env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
var r, s = 0;
|
||||
function next() {
|
||||
while (r = env.stack.pop()) {
|
||||
try {
|
||||
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
||||
if (r.dispose) {
|
||||
var result = r.dispose.call(r.value);
|
||||
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
||||
fail(e);
|
||||
return next();
|
||||
});
|
||||
} else s |= 1;
|
||||
} catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
}
|
||||
function __rewriteRelativeImportExtension(path, preserveJsx) {
|
||||
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
||||
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
||||
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
||||
});
|
||||
}
|
||||
return path;
|
||||
}
|
||||
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
||||
var init_tslib_es6 = __esm({
|
||||
"../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"() {
|
||||
extendStatics = function(d, b) {
|
||||
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
||||
d2.__proto__ = b2;
|
||||
} || function(d2, b2) {
|
||||
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
|
||||
};
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
__assign = function() {
|
||||
__assign = Object.assign || function __assign2(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
__createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === void 0) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() {
|
||||
return m[k];
|
||||
} };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === void 0) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
__setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
||||
var ar = [];
|
||||
for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
_SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
tslib_es6_default = {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__createBinding,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
__rewriteRelativeImportExtension
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
__assign,
|
||||
__rest,
|
||||
__awaiter,
|
||||
__spreadArray,
|
||||
tslib_es6_exports,
|
||||
init_tslib_es6
|
||||
};
|
||||
//# sourceMappingURL=chunk-B3JW6XJO.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-B3JW6XJO.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-B3JW6XJO.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
20220
canvas-demo/node_modules/.vite/deps/chunk-DZXNXIW7.js
generated
vendored
Normal file
20220
canvas-demo/node_modules/.vite/deps/chunk-DZXNXIW7.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/chunk-DZXNXIW7.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-DZXNXIW7.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
884
canvas-demo/node_modules/.vite/deps/chunk-HZEBPUXZ.js
generated
vendored
Normal file
884
canvas-demo/node_modules/.vite/deps/chunk-HZEBPUXZ.js
generated
vendored
Normal file
|
|
@ -0,0 +1,884 @@
|
|||
import {
|
||||
require_react
|
||||
} from "./chunk-T3SJLYUH.js";
|
||||
import {
|
||||
__toESM
|
||||
} from "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/jotai@2.16.0_@babel+core@7.28.5_@babel+template@7.27.2_@types+react@19.2.7_react@19.2.3/node_modules/jotai/esm/vanilla/internals.mjs
|
||||
function hasInitialValue(atom2) {
|
||||
return "init" in atom2;
|
||||
}
|
||||
function isActuallyWritableAtom(atom2) {
|
||||
return !!atom2.write;
|
||||
}
|
||||
function isAtomStateInitialized(atomState) {
|
||||
return "v" in atomState || "e" in atomState;
|
||||
}
|
||||
function returnAtomValue(atomState) {
|
||||
if ("e" in atomState) {
|
||||
throw atomState.e;
|
||||
}
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !("v" in atomState)) {
|
||||
throw new Error("[Bug] atom state is not initialized");
|
||||
}
|
||||
return atomState.v;
|
||||
}
|
||||
var promiseStateMap = /* @__PURE__ */ new WeakMap();
|
||||
function isPendingPromise(value) {
|
||||
var _a;
|
||||
return isPromiseLike(value) && !!((_a = promiseStateMap.get(value)) == null ? void 0 : _a[0]);
|
||||
}
|
||||
function abortPromise(promise) {
|
||||
const promiseState = promiseStateMap.get(promise);
|
||||
if (promiseState == null ? void 0 : promiseState[0]) {
|
||||
promiseState[0] = false;
|
||||
promiseState[1].forEach((fn) => fn());
|
||||
}
|
||||
}
|
||||
function registerAbortHandler(promise, abortHandler) {
|
||||
let promiseState = promiseStateMap.get(promise);
|
||||
if (!promiseState) {
|
||||
promiseState = [true, /* @__PURE__ */ new Set()];
|
||||
promiseStateMap.set(promise, promiseState);
|
||||
const settle = () => {
|
||||
promiseState[0] = false;
|
||||
};
|
||||
promise.then(settle, settle);
|
||||
}
|
||||
promiseState[1].add(abortHandler);
|
||||
}
|
||||
function isPromiseLike(p) {
|
||||
return typeof (p == null ? void 0 : p.then) === "function";
|
||||
}
|
||||
function addPendingPromiseToDependency(atom2, promise, dependencyAtomState) {
|
||||
if (!dependencyAtomState.p.has(atom2)) {
|
||||
dependencyAtomState.p.add(atom2);
|
||||
const cleanup = () => dependencyAtomState.p.delete(atom2);
|
||||
promise.then(cleanup, cleanup);
|
||||
}
|
||||
}
|
||||
function getMountedOrPendingDependents(atom2, atomState, mountedMap) {
|
||||
var _a;
|
||||
const dependents = /* @__PURE__ */ new Set();
|
||||
for (const a of ((_a = mountedMap.get(atom2)) == null ? void 0 : _a.t) || []) {
|
||||
dependents.add(a);
|
||||
}
|
||||
for (const atomWithPendingPromise of atomState.p) {
|
||||
dependents.add(atomWithPendingPromise);
|
||||
}
|
||||
return dependents;
|
||||
}
|
||||
var atomRead = (_store, atom2, ...params) => atom2.read(...params);
|
||||
var atomWrite = (_store, atom2, ...params) => atom2.write(...params);
|
||||
var atomOnInit = (store, atom2) => {
|
||||
if (atom2.INTERNAL_onInit) {
|
||||
return atom2.INTERNAL_onInit(store);
|
||||
}
|
||||
if (atom2.unstable_onInit) {
|
||||
console.warn(
|
||||
"[DEPRECATED] atom.unstable_onInit is renamed to atom.INTERNAL_onInit."
|
||||
);
|
||||
return atom2.unstable_onInit(store);
|
||||
}
|
||||
};
|
||||
var atomOnMount = (_store, atom2, setAtom) => {
|
||||
var _a;
|
||||
return (_a = atom2.onMount) == null ? void 0 : _a.call(atom2, setAtom);
|
||||
};
|
||||
var ensureAtomState = (store, atom2) => {
|
||||
var _a;
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const atomStateMap = buildingBlocks[0];
|
||||
const storeHooks = buildingBlocks[6];
|
||||
const atomOnInit2 = buildingBlocks[9];
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !atom2) {
|
||||
throw new Error("Atom is undefined or null");
|
||||
}
|
||||
let atomState = atomStateMap.get(atom2);
|
||||
if (!atomState) {
|
||||
atomState = { d: /* @__PURE__ */ new Map(), p: /* @__PURE__ */ new Set(), n: 0 };
|
||||
atomStateMap.set(atom2, atomState);
|
||||
(_a = storeHooks.i) == null ? void 0 : _a.call(storeHooks, atom2);
|
||||
atomOnInit2 == null ? void 0 : atomOnInit2(store, atom2);
|
||||
}
|
||||
return atomState;
|
||||
};
|
||||
var flushCallbacks = (store) => {
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const mountedMap = buildingBlocks[1];
|
||||
const changedAtoms = buildingBlocks[3];
|
||||
const mountCallbacks = buildingBlocks[4];
|
||||
const unmountCallbacks = buildingBlocks[5];
|
||||
const storeHooks = buildingBlocks[6];
|
||||
const recomputeInvalidatedAtoms2 = buildingBlocks[13];
|
||||
const errors = [];
|
||||
const call = (fn) => {
|
||||
try {
|
||||
fn();
|
||||
} catch (e) {
|
||||
errors.push(e);
|
||||
}
|
||||
};
|
||||
do {
|
||||
if (storeHooks.f) {
|
||||
call(storeHooks.f);
|
||||
}
|
||||
const callbacks = /* @__PURE__ */ new Set();
|
||||
const add = callbacks.add.bind(callbacks);
|
||||
changedAtoms.forEach((atom2) => {
|
||||
var _a;
|
||||
return (_a = mountedMap.get(atom2)) == null ? void 0 : _a.l.forEach(add);
|
||||
});
|
||||
changedAtoms.clear();
|
||||
unmountCallbacks.forEach(add);
|
||||
unmountCallbacks.clear();
|
||||
mountCallbacks.forEach(add);
|
||||
mountCallbacks.clear();
|
||||
callbacks.forEach(call);
|
||||
if (changedAtoms.size) {
|
||||
recomputeInvalidatedAtoms2(store);
|
||||
}
|
||||
} while (changedAtoms.size || unmountCallbacks.size || mountCallbacks.size);
|
||||
if (errors.length) {
|
||||
throw new AggregateError(errors);
|
||||
}
|
||||
};
|
||||
var recomputeInvalidatedAtoms = (store) => {
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const mountedMap = buildingBlocks[1];
|
||||
const invalidatedAtoms = buildingBlocks[2];
|
||||
const changedAtoms = buildingBlocks[3];
|
||||
const ensureAtomState2 = buildingBlocks[11];
|
||||
const readAtomState2 = buildingBlocks[14];
|
||||
const mountDependencies2 = buildingBlocks[17];
|
||||
const topSortedReversed = [];
|
||||
const visiting = /* @__PURE__ */ new WeakSet();
|
||||
const visited = /* @__PURE__ */ new WeakSet();
|
||||
const stack = Array.from(changedAtoms);
|
||||
while (stack.length) {
|
||||
const a = stack[stack.length - 1];
|
||||
const aState = ensureAtomState2(store, a);
|
||||
if (visited.has(a)) {
|
||||
stack.pop();
|
||||
continue;
|
||||
}
|
||||
if (visiting.has(a)) {
|
||||
if (invalidatedAtoms.get(a) === aState.n) {
|
||||
topSortedReversed.push([a, aState]);
|
||||
} else if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && invalidatedAtoms.has(a)) {
|
||||
throw new Error("[Bug] invalidated atom exists");
|
||||
}
|
||||
visited.add(a);
|
||||
stack.pop();
|
||||
continue;
|
||||
}
|
||||
visiting.add(a);
|
||||
for (const d of getMountedOrPendingDependents(a, aState, mountedMap)) {
|
||||
if (!visiting.has(d)) {
|
||||
stack.push(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = topSortedReversed.length - 1; i >= 0; --i) {
|
||||
const [a, aState] = topSortedReversed[i];
|
||||
let hasChangedDeps = false;
|
||||
for (const dep of aState.d.keys()) {
|
||||
if (dep !== a && changedAtoms.has(dep)) {
|
||||
hasChangedDeps = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasChangedDeps) {
|
||||
readAtomState2(store, a);
|
||||
mountDependencies2(store, a);
|
||||
}
|
||||
invalidatedAtoms.delete(a);
|
||||
}
|
||||
};
|
||||
var storeMutationSet = /* @__PURE__ */ new WeakSet();
|
||||
var readAtomState = (store, atom2) => {
|
||||
var _a, _b;
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const mountedMap = buildingBlocks[1];
|
||||
const invalidatedAtoms = buildingBlocks[2];
|
||||
const changedAtoms = buildingBlocks[3];
|
||||
const storeHooks = buildingBlocks[6];
|
||||
const atomRead2 = buildingBlocks[7];
|
||||
const ensureAtomState2 = buildingBlocks[11];
|
||||
const flushCallbacks2 = buildingBlocks[12];
|
||||
const recomputeInvalidatedAtoms2 = buildingBlocks[13];
|
||||
const readAtomState2 = buildingBlocks[14];
|
||||
const writeAtomState2 = buildingBlocks[16];
|
||||
const mountDependencies2 = buildingBlocks[17];
|
||||
const atomState = ensureAtomState2(store, atom2);
|
||||
if (isAtomStateInitialized(atomState)) {
|
||||
if (mountedMap.has(atom2) && invalidatedAtoms.get(atom2) !== atomState.n) {
|
||||
return atomState;
|
||||
}
|
||||
let hasChangedDeps = false;
|
||||
for (const [a, n] of atomState.d) {
|
||||
if (readAtomState2(store, a).n !== n) {
|
||||
hasChangedDeps = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasChangedDeps) {
|
||||
return atomState;
|
||||
}
|
||||
}
|
||||
atomState.d.clear();
|
||||
let isSync = true;
|
||||
function mountDependenciesIfAsync() {
|
||||
if (mountedMap.has(atom2)) {
|
||||
mountDependencies2(store, atom2);
|
||||
recomputeInvalidatedAtoms2(store);
|
||||
flushCallbacks2(store);
|
||||
}
|
||||
}
|
||||
function getter(a) {
|
||||
var _a2;
|
||||
if (a === atom2) {
|
||||
const aState2 = ensureAtomState2(store, a);
|
||||
if (!isAtomStateInitialized(aState2)) {
|
||||
if (hasInitialValue(a)) {
|
||||
setAtomStateValueOrPromise(store, a, a.init);
|
||||
} else {
|
||||
throw new Error("no atom init");
|
||||
}
|
||||
}
|
||||
return returnAtomValue(aState2);
|
||||
}
|
||||
const aState = readAtomState2(store, a);
|
||||
try {
|
||||
return returnAtomValue(aState);
|
||||
} finally {
|
||||
atomState.d.set(a, aState.n);
|
||||
if (isPendingPromise(atomState.v)) {
|
||||
addPendingPromiseToDependency(atom2, atomState.v, aState);
|
||||
}
|
||||
if (mountedMap.has(atom2)) {
|
||||
(_a2 = mountedMap.get(a)) == null ? void 0 : _a2.t.add(atom2);
|
||||
}
|
||||
if (!isSync) {
|
||||
mountDependenciesIfAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
let controller;
|
||||
let setSelf;
|
||||
const options = {
|
||||
get signal() {
|
||||
if (!controller) {
|
||||
controller = new AbortController();
|
||||
}
|
||||
return controller.signal;
|
||||
},
|
||||
get setSelf() {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !isActuallyWritableAtom(atom2)) {
|
||||
console.warn("setSelf function cannot be used with read-only atom");
|
||||
}
|
||||
if (!setSelf && isActuallyWritableAtom(atom2)) {
|
||||
setSelf = (...args) => {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && isSync) {
|
||||
console.warn("setSelf function cannot be called in sync");
|
||||
}
|
||||
if (!isSync) {
|
||||
try {
|
||||
return writeAtomState2(store, atom2, ...args);
|
||||
} finally {
|
||||
recomputeInvalidatedAtoms2(store);
|
||||
flushCallbacks2(store);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
return setSelf;
|
||||
}
|
||||
};
|
||||
const prevEpochNumber = atomState.n;
|
||||
try {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
storeMutationSet.delete(store);
|
||||
}
|
||||
const valueOrPromise = atomRead2(store, atom2, getter, options);
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && storeMutationSet.has(store)) {
|
||||
console.warn(
|
||||
"Detected store mutation during atom read. This is not supported."
|
||||
);
|
||||
}
|
||||
setAtomStateValueOrPromise(store, atom2, valueOrPromise);
|
||||
if (isPromiseLike(valueOrPromise)) {
|
||||
registerAbortHandler(valueOrPromise, () => controller == null ? void 0 : controller.abort());
|
||||
valueOrPromise.then(mountDependenciesIfAsync, mountDependenciesIfAsync);
|
||||
}
|
||||
(_a = storeHooks.r) == null ? void 0 : _a.call(storeHooks, atom2);
|
||||
return atomState;
|
||||
} catch (error) {
|
||||
delete atomState.v;
|
||||
atomState.e = error;
|
||||
++atomState.n;
|
||||
return atomState;
|
||||
} finally {
|
||||
isSync = false;
|
||||
if (prevEpochNumber !== atomState.n && invalidatedAtoms.get(atom2) === prevEpochNumber) {
|
||||
invalidatedAtoms.set(atom2, atomState.n);
|
||||
changedAtoms.add(atom2);
|
||||
(_b = storeHooks.c) == null ? void 0 : _b.call(storeHooks, atom2);
|
||||
}
|
||||
}
|
||||
};
|
||||
var invalidateDependents = (store, atom2) => {
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const mountedMap = buildingBlocks[1];
|
||||
const invalidatedAtoms = buildingBlocks[2];
|
||||
const ensureAtomState2 = buildingBlocks[11];
|
||||
const stack = [atom2];
|
||||
while (stack.length) {
|
||||
const a = stack.pop();
|
||||
const aState = ensureAtomState2(store, a);
|
||||
for (const d of getMountedOrPendingDependents(a, aState, mountedMap)) {
|
||||
const dState = ensureAtomState2(store, d);
|
||||
invalidatedAtoms.set(d, dState.n);
|
||||
stack.push(d);
|
||||
}
|
||||
}
|
||||
};
|
||||
var writeAtomState = (store, atom2, ...args) => {
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const changedAtoms = buildingBlocks[3];
|
||||
const storeHooks = buildingBlocks[6];
|
||||
const atomWrite2 = buildingBlocks[8];
|
||||
const ensureAtomState2 = buildingBlocks[11];
|
||||
const flushCallbacks2 = buildingBlocks[12];
|
||||
const recomputeInvalidatedAtoms2 = buildingBlocks[13];
|
||||
const readAtomState2 = buildingBlocks[14];
|
||||
const invalidateDependents2 = buildingBlocks[15];
|
||||
const mountDependencies2 = buildingBlocks[17];
|
||||
let isSync = true;
|
||||
const getter = (a) => returnAtomValue(readAtomState2(store, a));
|
||||
const setter = (a, ...args2) => {
|
||||
var _a;
|
||||
const aState = ensureAtomState2(store, a);
|
||||
try {
|
||||
if (a === atom2) {
|
||||
if (!hasInitialValue(a)) {
|
||||
throw new Error("atom not writable");
|
||||
}
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
storeMutationSet.add(store);
|
||||
}
|
||||
const prevEpochNumber = aState.n;
|
||||
const v = args2[0];
|
||||
setAtomStateValueOrPromise(store, a, v);
|
||||
mountDependencies2(store, a);
|
||||
if (prevEpochNumber !== aState.n) {
|
||||
changedAtoms.add(a);
|
||||
invalidateDependents2(store, a);
|
||||
(_a = storeHooks.c) == null ? void 0 : _a.call(storeHooks, a);
|
||||
}
|
||||
return void 0;
|
||||
} else {
|
||||
return writeAtomState(store, a, ...args2);
|
||||
}
|
||||
} finally {
|
||||
if (!isSync) {
|
||||
recomputeInvalidatedAtoms2(store);
|
||||
flushCallbacks2(store);
|
||||
}
|
||||
}
|
||||
};
|
||||
try {
|
||||
return atomWrite2(store, atom2, getter, setter, ...args);
|
||||
} finally {
|
||||
isSync = false;
|
||||
}
|
||||
};
|
||||
var mountDependencies = (store, atom2) => {
|
||||
var _a;
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const mountedMap = buildingBlocks[1];
|
||||
const changedAtoms = buildingBlocks[3];
|
||||
const storeHooks = buildingBlocks[6];
|
||||
const ensureAtomState2 = buildingBlocks[11];
|
||||
const invalidateDependents2 = buildingBlocks[15];
|
||||
const mountAtom2 = buildingBlocks[18];
|
||||
const unmountAtom2 = buildingBlocks[19];
|
||||
const atomState = ensureAtomState2(store, atom2);
|
||||
const mounted = mountedMap.get(atom2);
|
||||
if (mounted && !isPendingPromise(atomState.v)) {
|
||||
for (const [a, n] of atomState.d) {
|
||||
if (!mounted.d.has(a)) {
|
||||
const aState = ensureAtomState2(store, a);
|
||||
const aMounted = mountAtom2(store, a);
|
||||
aMounted.t.add(atom2);
|
||||
mounted.d.add(a);
|
||||
if (n !== aState.n) {
|
||||
changedAtoms.add(a);
|
||||
invalidateDependents2(store, a);
|
||||
(_a = storeHooks.c) == null ? void 0 : _a.call(storeHooks, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const a of mounted.d) {
|
||||
if (!atomState.d.has(a)) {
|
||||
mounted.d.delete(a);
|
||||
const aMounted = unmountAtom2(store, a);
|
||||
aMounted == null ? void 0 : aMounted.t.delete(atom2);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var mountAtom = (store, atom2) => {
|
||||
var _a;
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const mountedMap = buildingBlocks[1];
|
||||
const mountCallbacks = buildingBlocks[4];
|
||||
const storeHooks = buildingBlocks[6];
|
||||
const atomOnMount2 = buildingBlocks[10];
|
||||
const ensureAtomState2 = buildingBlocks[11];
|
||||
const flushCallbacks2 = buildingBlocks[12];
|
||||
const recomputeInvalidatedAtoms2 = buildingBlocks[13];
|
||||
const readAtomState2 = buildingBlocks[14];
|
||||
const writeAtomState2 = buildingBlocks[16];
|
||||
const atomState = ensureAtomState2(store, atom2);
|
||||
let mounted = mountedMap.get(atom2);
|
||||
if (!mounted) {
|
||||
readAtomState2(store, atom2);
|
||||
for (const a of atomState.d.keys()) {
|
||||
const aMounted = mountAtom(store, a);
|
||||
aMounted.t.add(atom2);
|
||||
}
|
||||
mounted = {
|
||||
l: /* @__PURE__ */ new Set(),
|
||||
d: new Set(atomState.d.keys()),
|
||||
t: /* @__PURE__ */ new Set()
|
||||
};
|
||||
mountedMap.set(atom2, mounted);
|
||||
if (isActuallyWritableAtom(atom2)) {
|
||||
const processOnMount = () => {
|
||||
let isSync = true;
|
||||
const setAtom = (...args) => {
|
||||
try {
|
||||
return writeAtomState2(store, atom2, ...args);
|
||||
} finally {
|
||||
if (!isSync) {
|
||||
recomputeInvalidatedAtoms2(store);
|
||||
flushCallbacks2(store);
|
||||
}
|
||||
}
|
||||
};
|
||||
try {
|
||||
const onUnmount = atomOnMount2(store, atom2, setAtom);
|
||||
if (onUnmount) {
|
||||
mounted.u = () => {
|
||||
isSync = true;
|
||||
try {
|
||||
onUnmount();
|
||||
} finally {
|
||||
isSync = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
} finally {
|
||||
isSync = false;
|
||||
}
|
||||
};
|
||||
mountCallbacks.add(processOnMount);
|
||||
}
|
||||
(_a = storeHooks.m) == null ? void 0 : _a.call(storeHooks, atom2);
|
||||
}
|
||||
return mounted;
|
||||
};
|
||||
var unmountAtom = (store, atom2) => {
|
||||
var _a, _b;
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const mountedMap = buildingBlocks[1];
|
||||
const unmountCallbacks = buildingBlocks[5];
|
||||
const storeHooks = buildingBlocks[6];
|
||||
const ensureAtomState2 = buildingBlocks[11];
|
||||
const unmountAtom2 = buildingBlocks[19];
|
||||
const atomState = ensureAtomState2(store, atom2);
|
||||
let mounted = mountedMap.get(atom2);
|
||||
if (!mounted || mounted.l.size) {
|
||||
return mounted;
|
||||
}
|
||||
let isDependent = false;
|
||||
for (const a of mounted.t) {
|
||||
if ((_a = mountedMap.get(a)) == null ? void 0 : _a.d.has(atom2)) {
|
||||
isDependent = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isDependent) {
|
||||
if (mounted.u) {
|
||||
unmountCallbacks.add(mounted.u);
|
||||
}
|
||||
mounted = void 0;
|
||||
mountedMap.delete(atom2);
|
||||
for (const a of atomState.d.keys()) {
|
||||
const aMounted = unmountAtom2(store, a);
|
||||
aMounted == null ? void 0 : aMounted.t.delete(atom2);
|
||||
}
|
||||
(_b = storeHooks.u) == null ? void 0 : _b.call(storeHooks, atom2);
|
||||
return void 0;
|
||||
}
|
||||
return mounted;
|
||||
};
|
||||
var setAtomStateValueOrPromise = (store, atom2, valueOrPromise) => {
|
||||
const ensureAtomState2 = getInternalBuildingBlocks(store)[11];
|
||||
const atomState = ensureAtomState2(store, atom2);
|
||||
const hasPrevValue = "v" in atomState;
|
||||
const prevValue = atomState.v;
|
||||
if (isPromiseLike(valueOrPromise)) {
|
||||
for (const a of atomState.d.keys()) {
|
||||
addPendingPromiseToDependency(
|
||||
atom2,
|
||||
valueOrPromise,
|
||||
ensureAtomState2(store, a)
|
||||
);
|
||||
}
|
||||
}
|
||||
atomState.v = valueOrPromise;
|
||||
delete atomState.e;
|
||||
if (!hasPrevValue || !Object.is(prevValue, atomState.v)) {
|
||||
++atomState.n;
|
||||
if (isPromiseLike(prevValue)) {
|
||||
abortPromise(prevValue);
|
||||
}
|
||||
}
|
||||
};
|
||||
var storeGet = (store, atom2) => {
|
||||
const readAtomState2 = getInternalBuildingBlocks(store)[14];
|
||||
return returnAtomValue(readAtomState2(store, atom2));
|
||||
};
|
||||
var storeSet = (store, atom2, ...args) => {
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const flushCallbacks2 = buildingBlocks[12];
|
||||
const recomputeInvalidatedAtoms2 = buildingBlocks[13];
|
||||
const writeAtomState2 = buildingBlocks[16];
|
||||
try {
|
||||
return writeAtomState2(store, atom2, ...args);
|
||||
} finally {
|
||||
recomputeInvalidatedAtoms2(store);
|
||||
flushCallbacks2(store);
|
||||
}
|
||||
};
|
||||
var storeSub = (store, atom2, listener) => {
|
||||
const buildingBlocks = getInternalBuildingBlocks(store);
|
||||
const flushCallbacks2 = buildingBlocks[12];
|
||||
const mountAtom2 = buildingBlocks[18];
|
||||
const unmountAtom2 = buildingBlocks[19];
|
||||
const mounted = mountAtom2(store, atom2);
|
||||
const listeners = mounted.l;
|
||||
listeners.add(listener);
|
||||
flushCallbacks2(store);
|
||||
return () => {
|
||||
listeners.delete(listener);
|
||||
unmountAtom2(store, atom2);
|
||||
flushCallbacks2(store);
|
||||
};
|
||||
};
|
||||
var buildingBlockMap = /* @__PURE__ */ new WeakMap();
|
||||
var getInternalBuildingBlocks = (store) => {
|
||||
const buildingBlocks = buildingBlockMap.get(store);
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !buildingBlocks) {
|
||||
throw new Error(
|
||||
"Store must be created by buildStore to read its building blocks"
|
||||
);
|
||||
}
|
||||
return buildingBlocks;
|
||||
};
|
||||
function buildStore(...buildArgs) {
|
||||
const store = {
|
||||
get(atom2) {
|
||||
const storeGet2 = getInternalBuildingBlocks(store)[21];
|
||||
return storeGet2(store, atom2);
|
||||
},
|
||||
set(atom2, ...args) {
|
||||
const storeSet2 = getInternalBuildingBlocks(store)[22];
|
||||
return storeSet2(store, atom2, ...args);
|
||||
},
|
||||
sub(atom2, listener) {
|
||||
const storeSub2 = getInternalBuildingBlocks(store)[23];
|
||||
return storeSub2(store, atom2, listener);
|
||||
}
|
||||
};
|
||||
const buildingBlocks = [
|
||||
// store state
|
||||
/* @__PURE__ */ new WeakMap(),
|
||||
// atomStateMap
|
||||
/* @__PURE__ */ new WeakMap(),
|
||||
// mountedMap
|
||||
/* @__PURE__ */ new WeakMap(),
|
||||
// invalidatedAtoms
|
||||
/* @__PURE__ */ new Set(),
|
||||
// changedAtoms
|
||||
/* @__PURE__ */ new Set(),
|
||||
// mountCallbacks
|
||||
/* @__PURE__ */ new Set(),
|
||||
// unmountCallbacks
|
||||
{},
|
||||
// storeHooks
|
||||
// atom interceptors
|
||||
atomRead,
|
||||
atomWrite,
|
||||
atomOnInit,
|
||||
atomOnMount,
|
||||
// building-block functions
|
||||
ensureAtomState,
|
||||
flushCallbacks,
|
||||
recomputeInvalidatedAtoms,
|
||||
readAtomState,
|
||||
invalidateDependents,
|
||||
writeAtomState,
|
||||
mountDependencies,
|
||||
mountAtom,
|
||||
unmountAtom,
|
||||
setAtomStateValueOrPromise,
|
||||
storeGet,
|
||||
storeSet,
|
||||
storeSub,
|
||||
void 0
|
||||
].map((fn, i) => buildArgs[i] || fn);
|
||||
buildingBlockMap.set(store, Object.freeze(buildingBlocks));
|
||||
return store;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/jotai@2.16.0_@babel+core@7.28.5_@babel+template@7.27.2_@types+react@19.2.7_react@19.2.3/node_modules/jotai/esm/vanilla.mjs
|
||||
var keyCount = 0;
|
||||
function atom(read, write) {
|
||||
const key = `atom${++keyCount}`;
|
||||
const config = {
|
||||
toString() {
|
||||
return (import.meta.env ? import.meta.env.MODE : void 0) !== "production" && this.debugLabel ? key + ":" + this.debugLabel : key;
|
||||
}
|
||||
};
|
||||
if (typeof read === "function") {
|
||||
config.read = read;
|
||||
} else {
|
||||
config.init = read;
|
||||
config.read = defaultRead;
|
||||
config.write = defaultWrite;
|
||||
}
|
||||
if (write) {
|
||||
config.write = write;
|
||||
}
|
||||
return config;
|
||||
}
|
||||
function defaultRead(get) {
|
||||
return get(this);
|
||||
}
|
||||
function defaultWrite(get, set, arg) {
|
||||
return set(
|
||||
this,
|
||||
typeof arg === "function" ? arg(get(this)) : arg
|
||||
);
|
||||
}
|
||||
var overiddenCreateStore;
|
||||
function INTERNAL_overrideCreateStore(fn) {
|
||||
overiddenCreateStore = fn(overiddenCreateStore);
|
||||
}
|
||||
function createStore() {
|
||||
if (overiddenCreateStore) {
|
||||
return overiddenCreateStore();
|
||||
}
|
||||
return buildStore();
|
||||
}
|
||||
var defaultStore;
|
||||
function getDefaultStore() {
|
||||
if (!defaultStore) {
|
||||
defaultStore = createStore();
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
globalThis.__JOTAI_DEFAULT_STORE__ || (globalThis.__JOTAI_DEFAULT_STORE__ = defaultStore);
|
||||
if (globalThis.__JOTAI_DEFAULT_STORE__ !== defaultStore) {
|
||||
console.warn(
|
||||
"Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultStore;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/jotai@2.16.0_@babel+core@7.28.5_@babel+template@7.27.2_@types+react@19.2.7_react@19.2.3/node_modules/jotai/esm/react.mjs
|
||||
var import_react = __toESM(require_react(), 1);
|
||||
var StoreContext = (0, import_react.createContext)(
|
||||
void 0
|
||||
);
|
||||
function useStore(options) {
|
||||
const store = (0, import_react.useContext)(StoreContext);
|
||||
return (options == null ? void 0 : options.store) || store || getDefaultStore();
|
||||
}
|
||||
function Provider({
|
||||
children,
|
||||
store
|
||||
}) {
|
||||
const storeRef = (0, import_react.useRef)(null);
|
||||
if (store) {
|
||||
return (0, import_react.createElement)(StoreContext.Provider, { value: store }, children);
|
||||
}
|
||||
if (storeRef.current === null) {
|
||||
storeRef.current = createStore();
|
||||
}
|
||||
return (0, import_react.createElement)(
|
||||
StoreContext.Provider,
|
||||
{
|
||||
// TODO: If this is not a false positive, consider using useState instead of useRef like https://github.com/pmndrs/jotai/pull/2771
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
value: storeRef.current
|
||||
},
|
||||
children
|
||||
);
|
||||
}
|
||||
var isPromiseLike2 = (x) => typeof (x == null ? void 0 : x.then) === "function";
|
||||
var attachPromiseStatus = (promise) => {
|
||||
if (!promise.status) {
|
||||
promise.status = "pending";
|
||||
promise.then(
|
||||
(v) => {
|
||||
promise.status = "fulfilled";
|
||||
promise.value = v;
|
||||
},
|
||||
(e) => {
|
||||
promise.status = "rejected";
|
||||
promise.reason = e;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
var use = import_react.default.use || // A shim for older React versions
|
||||
((promise) => {
|
||||
if (promise.status === "pending") {
|
||||
throw promise;
|
||||
} else if (promise.status === "fulfilled") {
|
||||
return promise.value;
|
||||
} else if (promise.status === "rejected") {
|
||||
throw promise.reason;
|
||||
} else {
|
||||
attachPromiseStatus(promise);
|
||||
throw promise;
|
||||
}
|
||||
});
|
||||
var continuablePromiseMap = /* @__PURE__ */ new WeakMap();
|
||||
var createContinuablePromise = (promise, getValue) => {
|
||||
let continuablePromise = continuablePromiseMap.get(promise);
|
||||
if (!continuablePromise) {
|
||||
continuablePromise = new Promise((resolve, reject) => {
|
||||
let curr = promise;
|
||||
const onFulfilled = (me) => (v) => {
|
||||
if (curr === me) {
|
||||
resolve(v);
|
||||
}
|
||||
};
|
||||
const onRejected = (me) => (e) => {
|
||||
if (curr === me) {
|
||||
reject(e);
|
||||
}
|
||||
};
|
||||
const onAbort = () => {
|
||||
try {
|
||||
const nextValue = getValue();
|
||||
if (isPromiseLike2(nextValue)) {
|
||||
continuablePromiseMap.set(nextValue, continuablePromise);
|
||||
curr = nextValue;
|
||||
nextValue.then(onFulfilled(nextValue), onRejected(nextValue));
|
||||
registerAbortHandler(nextValue, onAbort);
|
||||
} else {
|
||||
resolve(nextValue);
|
||||
}
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
};
|
||||
promise.then(onFulfilled(promise), onRejected(promise));
|
||||
registerAbortHandler(promise, onAbort);
|
||||
});
|
||||
continuablePromiseMap.set(promise, continuablePromise);
|
||||
}
|
||||
return continuablePromise;
|
||||
};
|
||||
function useAtomValue(atom2, options) {
|
||||
const { delay, unstable_promiseStatus: promiseStatus = !import_react.default.use } = options || {};
|
||||
const store = useStore(options);
|
||||
const [[valueFromReducer, storeFromReducer, atomFromReducer], rerender] = (0, import_react.useReducer)(
|
||||
(prev) => {
|
||||
const nextValue = store.get(atom2);
|
||||
if (Object.is(prev[0], nextValue) && prev[1] === store && prev[2] === atom2) {
|
||||
return prev;
|
||||
}
|
||||
return [nextValue, store, atom2];
|
||||
},
|
||||
void 0,
|
||||
() => [store.get(atom2), store, atom2]
|
||||
);
|
||||
let value = valueFromReducer;
|
||||
if (storeFromReducer !== store || atomFromReducer !== atom2) {
|
||||
rerender();
|
||||
value = store.get(atom2);
|
||||
}
|
||||
(0, import_react.useEffect)(() => {
|
||||
const unsub = store.sub(atom2, () => {
|
||||
if (promiseStatus) {
|
||||
try {
|
||||
const value2 = store.get(atom2);
|
||||
if (isPromiseLike2(value2)) {
|
||||
attachPromiseStatus(
|
||||
createContinuablePromise(value2, () => store.get(atom2))
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
if (typeof delay === "number") {
|
||||
setTimeout(rerender, delay);
|
||||
return;
|
||||
}
|
||||
rerender();
|
||||
});
|
||||
rerender();
|
||||
return unsub;
|
||||
}, [store, atom2, delay, promiseStatus]);
|
||||
(0, import_react.useDebugValue)(value);
|
||||
if (isPromiseLike2(value)) {
|
||||
const promise = createContinuablePromise(value, () => store.get(atom2));
|
||||
if (promiseStatus) {
|
||||
attachPromiseStatus(promise);
|
||||
}
|
||||
return use(promise);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function useSetAtom(atom2, options) {
|
||||
const store = useStore(options);
|
||||
const setAtom = (0, import_react.useCallback)(
|
||||
(...args) => {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !("write" in atom2)) {
|
||||
throw new Error("not writable atom");
|
||||
}
|
||||
return store.set(atom2, ...args);
|
||||
},
|
||||
[store, atom2]
|
||||
);
|
||||
return setAtom;
|
||||
}
|
||||
function useAtom(atom2, options) {
|
||||
return [
|
||||
useAtomValue(atom2, options),
|
||||
// We do wrong type assertion here, which results in throwing an error.
|
||||
useSetAtom(atom2, options)
|
||||
];
|
||||
}
|
||||
|
||||
export {
|
||||
atom,
|
||||
INTERNAL_overrideCreateStore,
|
||||
createStore,
|
||||
getDefaultStore,
|
||||
useStore,
|
||||
Provider,
|
||||
useAtomValue,
|
||||
useSetAtom,
|
||||
useAtom
|
||||
};
|
||||
//# sourceMappingURL=chunk-HZEBPUXZ.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-HZEBPUXZ.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-HZEBPUXZ.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
167
canvas-demo/node_modules/.vite/deps/chunk-KLRFSZSC.js
generated
vendored
Normal file
167
canvas-demo/node_modules/.vite/deps/chunk-KLRFSZSC.js
generated
vendored
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-YAGB2RBV.js";
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-T3SJLYUH.js";
|
||||
import {
|
||||
__toESM
|
||||
} from "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.7_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
|
||||
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.2.7_react@19.2.3/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
||||
var React = __toESM(require_react(), 1);
|
||||
function setRef(ref, value) {
|
||||
if (typeof ref === "function") {
|
||||
return ref(value);
|
||||
} else if (ref !== null && ref !== void 0) {
|
||||
ref.current = value;
|
||||
}
|
||||
}
|
||||
function composeRefs(...refs) {
|
||||
return (node) => {
|
||||
let hasCleanup = false;
|
||||
const cleanups = refs.map((ref) => {
|
||||
const cleanup = setRef(ref, node);
|
||||
if (!hasCleanup && typeof cleanup == "function") {
|
||||
hasCleanup = true;
|
||||
}
|
||||
return cleanup;
|
||||
});
|
||||
if (hasCleanup) {
|
||||
return () => {
|
||||
for (let i = 0; i < cleanups.length; i++) {
|
||||
const cleanup = cleanups[i];
|
||||
if (typeof cleanup == "function") {
|
||||
cleanup();
|
||||
} else {
|
||||
setRef(refs[i], null);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
function useComposedRefs(...refs) {
|
||||
return React.useCallback(composeRefs(...refs), refs);
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.7_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
||||
var use = React2[" use ".trim().toString()];
|
||||
function isPromiseLike(value) {
|
||||
return typeof value === "object" && value !== null && "then" in value;
|
||||
}
|
||||
function isLazyComponent(element) {
|
||||
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
||||
}
|
||||
function createSlot(ownerName) {
|
||||
const SlotClone = createSlotClone(ownerName);
|
||||
const Slot2 = React2.forwardRef((props, forwardedRef) => {
|
||||
let { children, ...slotProps } = props;
|
||||
if (isLazyComponent(children) && typeof use === "function") {
|
||||
children = use(children._payload);
|
||||
}
|
||||
const childrenArray = React2.Children.toArray(children);
|
||||
const slottable = childrenArray.find(isSlottable);
|
||||
if (slottable) {
|
||||
const newElement = slottable.props.children;
|
||||
const newChildren = childrenArray.map((child) => {
|
||||
if (child === slottable) {
|
||||
if (React2.Children.count(newElement) > 1) return React2.Children.only(null);
|
||||
return React2.isValidElement(newElement) ? newElement.props.children : null;
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
});
|
||||
return (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
|
||||
}
|
||||
return (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
||||
});
|
||||
Slot2.displayName = `${ownerName}.Slot`;
|
||||
return Slot2;
|
||||
}
|
||||
var Slot = createSlot("Slot");
|
||||
function createSlotClone(ownerName) {
|
||||
const SlotClone = React2.forwardRef((props, forwardedRef) => {
|
||||
let { children, ...slotProps } = props;
|
||||
if (isLazyComponent(children) && typeof use === "function") {
|
||||
children = use(children._payload);
|
||||
}
|
||||
if (React2.isValidElement(children)) {
|
||||
const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React2.Fragment) {
|
||||
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
||||
}
|
||||
return React2.cloneElement(children, props2);
|
||||
}
|
||||
return React2.Children.count(children) > 1 ? React2.Children.only(null) : null;
|
||||
});
|
||||
SlotClone.displayName = `${ownerName}.SlotClone`;
|
||||
return SlotClone;
|
||||
}
|
||||
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
||||
function createSlottable(ownerName) {
|
||||
const Slottable2 = ({ children }) => {
|
||||
return (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
||||
};
|
||||
Slottable2.displayName = `${ownerName}.Slottable`;
|
||||
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
||||
return Slottable2;
|
||||
}
|
||||
var Slottable = createSlottable("Slottable");
|
||||
function isSlottable(child) {
|
||||
return React2.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
||||
}
|
||||
function mergeProps(slotProps, childProps) {
|
||||
const overrideProps = { ...childProps };
|
||||
for (const propName in childProps) {
|
||||
const slotPropValue = slotProps[propName];
|
||||
const childPropValue = childProps[propName];
|
||||
const isHandler = /^on[A-Z]/.test(propName);
|
||||
if (isHandler) {
|
||||
if (slotPropValue && childPropValue) {
|
||||
overrideProps[propName] = (...args) => {
|
||||
const result = childPropValue(...args);
|
||||
slotPropValue(...args);
|
||||
return result;
|
||||
};
|
||||
} else if (slotPropValue) {
|
||||
overrideProps[propName] = slotPropValue;
|
||||
}
|
||||
} else if (propName === "style") {
|
||||
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
||||
} else if (propName === "className") {
|
||||
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
||||
}
|
||||
}
|
||||
return { ...slotProps, ...overrideProps };
|
||||
}
|
||||
function getElementRef(element) {
|
||||
var _a, _b;
|
||||
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
||||
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.ref;
|
||||
}
|
||||
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
||||
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.props.ref;
|
||||
}
|
||||
return element.props.ref || element.ref;
|
||||
}
|
||||
|
||||
export {
|
||||
composeRefs,
|
||||
useComposedRefs,
|
||||
createSlot,
|
||||
Slot,
|
||||
createSlottable,
|
||||
Slottable
|
||||
};
|
||||
//# sourceMappingURL=chunk-KLRFSZSC.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-KLRFSZSC.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-KLRFSZSC.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
280
canvas-demo/node_modules/.vite/deps/chunk-LRUX6XQC.js
generated
vendored
Normal file
280
canvas-demo/node_modules/.vite/deps/chunk-LRUX6XQC.js
generated
vendored
Normal file
|
|
@ -0,0 +1,280 @@
|
|||
import {
|
||||
require_react
|
||||
} from "./chunk-T3SJLYUH.js";
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.development.js
|
||||
var require_react_dom_development = __commonJS({
|
||||
"../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.development.js"(exports) {
|
||||
"use strict";
|
||||
(function() {
|
||||
function noop() {
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function createPortal$1(children, containerInfo, implementation) {
|
||||
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
||||
try {
|
||||
testStringCoercion(key);
|
||||
var JSCompiler_inline_result = false;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = true;
|
||||
}
|
||||
JSCompiler_inline_result && (console.error(
|
||||
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||
"function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"
|
||||
), testStringCoercion(key));
|
||||
return {
|
||||
$$typeof: REACT_PORTAL_TYPE,
|
||||
key: null == key ? null : "" + key,
|
||||
children,
|
||||
containerInfo,
|
||||
implementation
|
||||
};
|
||||
}
|
||||
function getCrossOriginStringAs(as, input) {
|
||||
if ("font" === as) return "";
|
||||
if ("string" === typeof input)
|
||||
return "use-credentials" === input ? input : "";
|
||||
}
|
||||
function getValueDescriptorExpectingObjectForWarning(thing) {
|
||||
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"';
|
||||
}
|
||||
function getValueDescriptorExpectingEnumForWarning(thing) {
|
||||
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
|
||||
}
|
||||
function resolveDispatcher() {
|
||||
var dispatcher = ReactSharedInternals.H;
|
||||
null === dispatcher && console.error(
|
||||
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
||||
);
|
||||
return dispatcher;
|
||||
}
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||
var React = require_react(), Internals = {
|
||||
d: {
|
||||
f: noop,
|
||||
r: function() {
|
||||
throw Error(
|
||||
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
||||
);
|
||||
},
|
||||
D: noop,
|
||||
C: noop,
|
||||
L: noop,
|
||||
m: noop,
|
||||
X: noop,
|
||||
S: noop,
|
||||
M: noop
|
||||
},
|
||||
p: 0,
|
||||
findDOMNode: null
|
||||
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
||||
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
||||
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
||||
);
|
||||
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
||||
exports.createPortal = function(children, container) {
|
||||
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
||||
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
||||
throw Error("Target container is not a DOM element.");
|
||||
return createPortal$1(children, container, null, key);
|
||||
};
|
||||
exports.flushSync = function(fn) {
|
||||
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
||||
try {
|
||||
if (ReactSharedInternals.T = null, Internals.p = 2, fn)
|
||||
return fn();
|
||||
} finally {
|
||||
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
|
||||
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
||||
);
|
||||
}
|
||||
};
|
||||
exports.preconnect = function(href, options) {
|
||||
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
|
||||
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
||||
getValueDescriptorExpectingEnumForWarning(options)
|
||||
) : null != options && "string" !== typeof options.crossOrigin && console.error(
|
||||
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
||||
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
|
||||
) : console.error(
|
||||
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||
getValueDescriptorExpectingObjectForWarning(href)
|
||||
);
|
||||
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
||||
};
|
||||
exports.prefetchDNS = function(href) {
|
||||
if ("string" !== typeof href || !href)
|
||||
console.error(
|
||||
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||
getValueDescriptorExpectingObjectForWarning(href)
|
||||
);
|
||||
else if (1 < arguments.length) {
|
||||
var options = arguments[1];
|
||||
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
|
||||
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
||||
getValueDescriptorExpectingEnumForWarning(options)
|
||||
) : console.error(
|
||||
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
||||
getValueDescriptorExpectingEnumForWarning(options)
|
||||
);
|
||||
}
|
||||
"string" === typeof href && Internals.d.D(href);
|
||||
};
|
||||
exports.preinit = function(href, options) {
|
||||
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error(
|
||||
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
||||
getValueDescriptorExpectingEnumForWarning(options)
|
||||
) : "style" !== options.as && "script" !== options.as && console.error(
|
||||
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
|
||||
getValueDescriptorExpectingEnumForWarning(options.as)
|
||||
) : console.error(
|
||||
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||
getValueDescriptorExpectingObjectForWarning(href)
|
||||
);
|
||||
if ("string" === typeof href && options && "string" === typeof options.as) {
|
||||
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
||||
"style" === as ? Internals.d.S(
|
||||
href,
|
||||
"string" === typeof options.precedence ? options.precedence : void 0,
|
||||
{
|
||||
crossOrigin,
|
||||
integrity,
|
||||
fetchPriority
|
||||
}
|
||||
) : "script" === as && Internals.d.X(href, {
|
||||
crossOrigin,
|
||||
integrity,
|
||||
fetchPriority,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.preinitModule = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
||||
if (encountered)
|
||||
console.error(
|
||||
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
|
||||
encountered
|
||||
);
|
||||
else
|
||||
switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
||||
case "script":
|
||||
break;
|
||||
default:
|
||||
encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error(
|
||||
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
|
||||
encountered,
|
||||
href
|
||||
);
|
||||
}
|
||||
if ("string" === typeof href)
|
||||
if ("object" === typeof options && null !== options) {
|
||||
if (null == options.as || "script" === options.as)
|
||||
encountered = getCrossOriginStringAs(
|
||||
options.as,
|
||||
options.crossOrigin
|
||||
), Internals.d.M(href, {
|
||||
crossOrigin: encountered,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||
});
|
||||
} else null == options && Internals.d.M(href);
|
||||
};
|
||||
exports.preload = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||
encountered && console.error(
|
||||
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
||||
encountered
|
||||
);
|
||||
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
||||
encountered = options.as;
|
||||
var crossOrigin = getCrossOriginStringAs(
|
||||
encountered,
|
||||
options.crossOrigin
|
||||
);
|
||||
Internals.d.L(href, encountered, {
|
||||
crossOrigin,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
||||
type: "string" === typeof options.type ? options.type : void 0,
|
||||
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
||||
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
||||
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
||||
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
||||
media: "string" === typeof options.media ? options.media : void 0
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.preloadModule = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||
encountered && console.error(
|
||||
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
||||
encountered
|
||||
);
|
||||
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(
|
||||
options.as,
|
||||
options.crossOrigin
|
||||
), Internals.d.m(href, {
|
||||
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
||||
crossOrigin: encountered,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
||||
})) : Internals.d.m(href));
|
||||
};
|
||||
exports.requestFormReset = function(form) {
|
||||
Internals.d.r(form);
|
||||
};
|
||||
exports.unstable_batchedUpdates = function(fn, a) {
|
||||
return fn(a);
|
||||
};
|
||||
exports.useFormState = function(action, initialState, permalink) {
|
||||
return resolveDispatcher().useFormState(action, initialState, permalink);
|
||||
};
|
||||
exports.useFormStatus = function() {
|
||||
return resolveDispatcher().useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.2.3";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// ../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js
|
||||
var require_react_dom = __commonJS({
|
||||
"../../node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js"(exports, module) {
|
||||
if (false) {
|
||||
checkDCE();
|
||||
module.exports = null;
|
||||
} else {
|
||||
module.exports = require_react_dom_development();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
require_react_dom
|
||||
};
|
||||
/*! Bundled license information:
|
||||
|
||||
react-dom/cjs/react-dom.development.js:
|
||||
(**
|
||||
* @license React
|
||||
* react-dom.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
*/
|
||||
//# sourceMappingURL=chunk-LRUX6XQC.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-LRUX6XQC.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-LRUX6XQC.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
81390
canvas-demo/node_modules/.vite/deps/chunk-PT7F464S.js
generated
vendored
Normal file
81390
canvas-demo/node_modules/.vite/deps/chunk-PT7F464S.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
canvas-demo/node_modules/.vite/deps/chunk-PT7F464S.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-PT7F464S.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
410
canvas-demo/node_modules/.vite/deps/chunk-RU4TY2CQ.js
generated
vendored
Normal file
410
canvas-demo/node_modules/.vite/deps/chunk-RU4TY2CQ.js
generated
vendored
Normal file
|
|
@ -0,0 +1,410 @@
|
|||
// ../../node_modules/.pnpm/@blocknote+core@0.45.0_@tiptap+extensions@3.14.0_@tiptap+core@3.14.0_@tiptap+pm@3.14.0__f23d443be271153d169671d52d4cc932/node_modules/@blocknote/core/dist/en-njEqD7AG.js
|
||||
var i = {
|
||||
slash_menu: {
|
||||
heading: {
|
||||
title: "Heading 1",
|
||||
subtext: "Top-level heading",
|
||||
aliases: ["h", "heading1", "h1"],
|
||||
group: "Headings"
|
||||
},
|
||||
heading_2: {
|
||||
title: "Heading 2",
|
||||
subtext: "Key section heading",
|
||||
aliases: ["h2", "heading2", "subheading"],
|
||||
group: "Headings"
|
||||
},
|
||||
heading_3: {
|
||||
title: "Heading 3",
|
||||
subtext: "Subsection and group heading",
|
||||
aliases: ["h3", "heading3", "subheading"],
|
||||
group: "Headings"
|
||||
},
|
||||
heading_4: {
|
||||
title: "Heading 4",
|
||||
subtext: "Minor subsection heading",
|
||||
aliases: ["h4", "heading4", "subheading4"],
|
||||
group: "Subheadings"
|
||||
},
|
||||
heading_5: {
|
||||
title: "Heading 5",
|
||||
subtext: "Small subsection heading",
|
||||
aliases: ["h5", "heading5", "subheading5"],
|
||||
group: "Subheadings"
|
||||
},
|
||||
heading_6: {
|
||||
title: "Heading 6",
|
||||
subtext: "Lowest-level heading",
|
||||
aliases: ["h6", "heading6", "subheading6"],
|
||||
group: "Subheadings"
|
||||
},
|
||||
toggle_heading: {
|
||||
title: "Toggle Heading 1",
|
||||
subtext: "Toggleable top-level heading",
|
||||
aliases: ["h", "heading1", "h1", "collapsable"],
|
||||
group: "Subheadings"
|
||||
},
|
||||
toggle_heading_2: {
|
||||
title: "Toggle Heading 2",
|
||||
subtext: "Toggleable key section heading",
|
||||
aliases: ["h2", "heading2", "subheading", "collapsable"],
|
||||
group: "Subheadings"
|
||||
},
|
||||
toggle_heading_3: {
|
||||
title: "Toggle Heading 3",
|
||||
subtext: "Toggleable subsection and group heading",
|
||||
aliases: ["h3", "heading3", "subheading", "collapsable"],
|
||||
group: "Subheadings"
|
||||
},
|
||||
quote: {
|
||||
title: "Quote",
|
||||
subtext: "Quote or excerpt",
|
||||
aliases: ["quotation", "blockquote", "bq"],
|
||||
group: "Basic blocks"
|
||||
},
|
||||
toggle_list: {
|
||||
title: "Toggle List",
|
||||
subtext: "List with hideable sub-items",
|
||||
aliases: ["li", "list", "toggleList", "toggle list", "collapsable list"],
|
||||
group: "Basic blocks"
|
||||
},
|
||||
numbered_list: {
|
||||
title: "Numbered List",
|
||||
subtext: "List with ordered items",
|
||||
aliases: ["ol", "li", "list", "numberedlist", "numbered list"],
|
||||
group: "Basic blocks"
|
||||
},
|
||||
bullet_list: {
|
||||
title: "Bullet List",
|
||||
subtext: "List with unordered items",
|
||||
aliases: ["ul", "li", "list", "bulletlist", "bullet list"],
|
||||
group: "Basic blocks"
|
||||
},
|
||||
check_list: {
|
||||
title: "Check List",
|
||||
subtext: "List with checkboxes",
|
||||
aliases: [
|
||||
"ul",
|
||||
"li",
|
||||
"list",
|
||||
"checklist",
|
||||
"check list",
|
||||
"checked list",
|
||||
"checkbox"
|
||||
],
|
||||
group: "Basic blocks"
|
||||
},
|
||||
paragraph: {
|
||||
title: "Paragraph",
|
||||
subtext: "The body of your document",
|
||||
aliases: ["p", "paragraph"],
|
||||
group: "Basic blocks"
|
||||
},
|
||||
code_block: {
|
||||
title: "Code Block",
|
||||
subtext: "Code block with syntax highlighting",
|
||||
aliases: ["code", "pre"],
|
||||
group: "Basic blocks"
|
||||
},
|
||||
page_break: {
|
||||
title: "Page Break",
|
||||
subtext: "Page separator",
|
||||
aliases: ["page", "break", "separator"],
|
||||
group: "Basic blocks"
|
||||
},
|
||||
table: {
|
||||
title: "Table",
|
||||
subtext: "Table with editable cells",
|
||||
aliases: ["table"],
|
||||
group: "Advanced"
|
||||
},
|
||||
image: {
|
||||
title: "Image",
|
||||
subtext: "Resizable image with caption",
|
||||
aliases: [
|
||||
"image",
|
||||
"imageUpload",
|
||||
"upload",
|
||||
"img",
|
||||
"picture",
|
||||
"media",
|
||||
"url"
|
||||
],
|
||||
group: "Media"
|
||||
},
|
||||
video: {
|
||||
title: "Video",
|
||||
subtext: "Resizable video with caption",
|
||||
aliases: [
|
||||
"video",
|
||||
"videoUpload",
|
||||
"upload",
|
||||
"mp4",
|
||||
"film",
|
||||
"media",
|
||||
"url"
|
||||
],
|
||||
group: "Media"
|
||||
},
|
||||
audio: {
|
||||
title: "Audio",
|
||||
subtext: "Embedded audio with caption",
|
||||
aliases: [
|
||||
"audio",
|
||||
"audioUpload",
|
||||
"upload",
|
||||
"mp3",
|
||||
"sound",
|
||||
"media",
|
||||
"url"
|
||||
],
|
||||
group: "Media"
|
||||
},
|
||||
file: {
|
||||
title: "File",
|
||||
subtext: "Embedded file",
|
||||
aliases: ["file", "upload", "embed", "media", "url"],
|
||||
group: "Media"
|
||||
},
|
||||
emoji: {
|
||||
title: "Emoji",
|
||||
subtext: "Search for and insert an emoji",
|
||||
aliases: ["emoji", "emote", "emotion", "face"],
|
||||
group: "Others"
|
||||
},
|
||||
divider: {
|
||||
title: "Divider",
|
||||
subtext: "Visually divide blocks",
|
||||
aliases: ["divider", "hr", "line", "horizontal rule"],
|
||||
group: "Basic blocks"
|
||||
}
|
||||
},
|
||||
placeholders: {
|
||||
default: "Enter text or type '/' for commands",
|
||||
heading: "Heading",
|
||||
toggleListItem: "Toggle",
|
||||
bulletListItem: "List",
|
||||
numberedListItem: "List",
|
||||
checkListItem: "List",
|
||||
emptyDocument: void 0,
|
||||
new_comment: "Write a comment...",
|
||||
edit_comment: "Edit comment...",
|
||||
comment_reply: "Add comment..."
|
||||
},
|
||||
file_blocks: {
|
||||
add_button_text: {
|
||||
image: "Add image",
|
||||
video: "Add video",
|
||||
audio: "Add audio",
|
||||
file: "Add file"
|
||||
}
|
||||
},
|
||||
toggle_blocks: {
|
||||
add_block_button: "Empty toggle. Click to add a block."
|
||||
},
|
||||
// from react package:
|
||||
side_menu: {
|
||||
add_block_label: "Add block",
|
||||
drag_handle_label: "Open block menu"
|
||||
},
|
||||
drag_handle: {
|
||||
delete_menuitem: "Delete",
|
||||
colors_menuitem: "Colors",
|
||||
header_row_menuitem: "Header row",
|
||||
header_column_menuitem: "Header column"
|
||||
},
|
||||
table_handle: {
|
||||
delete_column_menuitem: "Delete column",
|
||||
delete_row_menuitem: "Delete row",
|
||||
add_left_menuitem: "Add column left",
|
||||
add_right_menuitem: "Add column right",
|
||||
add_above_menuitem: "Add row above",
|
||||
add_below_menuitem: "Add row below",
|
||||
split_cell_menuitem: "Split cell",
|
||||
merge_cells_menuitem: "Merge cells",
|
||||
background_color_menuitem: "Background color"
|
||||
},
|
||||
suggestion_menu: {
|
||||
no_items_title: "No items found"
|
||||
},
|
||||
color_picker: {
|
||||
text_title: "Text",
|
||||
background_title: "Background",
|
||||
colors: {
|
||||
default: "Default",
|
||||
gray: "Gray",
|
||||
brown: "Brown",
|
||||
red: "Red",
|
||||
orange: "Orange",
|
||||
yellow: "Yellow",
|
||||
green: "Green",
|
||||
blue: "Blue",
|
||||
purple: "Purple",
|
||||
pink: "Pink"
|
||||
}
|
||||
},
|
||||
formatting_toolbar: {
|
||||
bold: {
|
||||
tooltip: "Bold",
|
||||
secondary_tooltip: "Mod+B"
|
||||
},
|
||||
italic: {
|
||||
tooltip: "Italic",
|
||||
secondary_tooltip: "Mod+I"
|
||||
},
|
||||
underline: {
|
||||
tooltip: "Underline",
|
||||
secondary_tooltip: "Mod+U"
|
||||
},
|
||||
strike: {
|
||||
tooltip: "Strike",
|
||||
secondary_tooltip: "Mod+Shift+S"
|
||||
},
|
||||
code: {
|
||||
tooltip: "Code",
|
||||
secondary_tooltip: ""
|
||||
},
|
||||
colors: {
|
||||
tooltip: "Colors"
|
||||
},
|
||||
link: {
|
||||
tooltip: "Create link",
|
||||
secondary_tooltip: "Mod+K"
|
||||
},
|
||||
file_caption: {
|
||||
tooltip: "Edit caption",
|
||||
input_placeholder: "Edit caption"
|
||||
},
|
||||
file_replace: {
|
||||
tooltip: {
|
||||
image: "Replace image",
|
||||
video: "Replace video",
|
||||
audio: "Replace audio",
|
||||
file: "Replace file"
|
||||
}
|
||||
},
|
||||
file_rename: {
|
||||
tooltip: {
|
||||
image: "Rename image",
|
||||
video: "Rename video",
|
||||
audio: "Rename audio",
|
||||
file: "Rename file"
|
||||
},
|
||||
input_placeholder: {
|
||||
image: "Rename image",
|
||||
video: "Rename video",
|
||||
audio: "Rename audio",
|
||||
file: "Rename file"
|
||||
}
|
||||
},
|
||||
file_download: {
|
||||
tooltip: {
|
||||
image: "Download image",
|
||||
video: "Download video",
|
||||
audio: "Download audio",
|
||||
file: "Download file"
|
||||
}
|
||||
},
|
||||
file_delete: {
|
||||
tooltip: {
|
||||
image: "Delete image",
|
||||
video: "Delete video",
|
||||
audio: "Delete audio",
|
||||
file: "Delete file"
|
||||
}
|
||||
},
|
||||
file_preview_toggle: {
|
||||
tooltip: "Toggle preview"
|
||||
},
|
||||
nest: {
|
||||
tooltip: "Nest block",
|
||||
secondary_tooltip: "Tab"
|
||||
},
|
||||
unnest: {
|
||||
tooltip: "Unnest block",
|
||||
secondary_tooltip: "Shift+Tab"
|
||||
},
|
||||
align_left: {
|
||||
tooltip: "Align text left"
|
||||
},
|
||||
align_center: {
|
||||
tooltip: "Align text center"
|
||||
},
|
||||
align_right: {
|
||||
tooltip: "Align text right"
|
||||
},
|
||||
align_justify: {
|
||||
tooltip: "Justify text"
|
||||
},
|
||||
table_cell_merge: {
|
||||
tooltip: "Merge cells"
|
||||
},
|
||||
comment: {
|
||||
tooltip: "Add comment"
|
||||
}
|
||||
},
|
||||
file_panel: {
|
||||
upload: {
|
||||
title: "Upload",
|
||||
file_placeholder: {
|
||||
image: "Upload image",
|
||||
video: "Upload video",
|
||||
audio: "Upload audio",
|
||||
file: "Upload file"
|
||||
},
|
||||
upload_error: "Error: Upload failed"
|
||||
},
|
||||
embed: {
|
||||
title: "Embed",
|
||||
embed_button: {
|
||||
image: "Embed image",
|
||||
video: "Embed video",
|
||||
audio: "Embed audio",
|
||||
file: "Embed file"
|
||||
},
|
||||
url_placeholder: "Enter URL"
|
||||
}
|
||||
},
|
||||
link_toolbar: {
|
||||
delete: {
|
||||
tooltip: "Remove link"
|
||||
},
|
||||
edit: {
|
||||
text: "Edit link",
|
||||
tooltip: "Edit"
|
||||
},
|
||||
open: {
|
||||
tooltip: "Open in new tab"
|
||||
},
|
||||
form: {
|
||||
title_placeholder: "Edit title",
|
||||
url_placeholder: "Edit URL"
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
edited: "edited",
|
||||
save_button_text: "Save",
|
||||
cancel_button_text: "Cancel",
|
||||
actions: {
|
||||
add_reaction: "Add reaction",
|
||||
resolve: "Resolve",
|
||||
edit_comment: "Edit comment",
|
||||
delete_comment: "Delete comment",
|
||||
more_actions: "More actions"
|
||||
},
|
||||
reactions: {
|
||||
reacted_by: "Reacted by"
|
||||
},
|
||||
sidebar: {
|
||||
marked_as_resolved: "Marked as resolved",
|
||||
more_replies: (e) => `${e} more replies`
|
||||
}
|
||||
},
|
||||
generic: {
|
||||
ctrl_shortcut: "Ctrl"
|
||||
}
|
||||
};
|
||||
|
||||
export {
|
||||
i
|
||||
};
|
||||
//# sourceMappingURL=chunk-RU4TY2CQ.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-RU4TY2CQ.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-RU4TY2CQ.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
21
canvas-demo/node_modules/.vite/deps/chunk-SIU35MPB.js
generated
vendored
Normal file
21
canvas-demo/node_modules/.vite/deps/chunk-SIU35MPB.js
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
||||
function r(e) {
|
||||
var t, f, n = "";
|
||||
if ("string" == typeof e || "number" == typeof e) n += e;
|
||||
else if ("object" == typeof e) if (Array.isArray(e)) {
|
||||
var o = e.length;
|
||||
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
||||
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
||||
return n;
|
||||
}
|
||||
function clsx() {
|
||||
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
||||
return n;
|
||||
}
|
||||
var clsx_default = clsx;
|
||||
|
||||
export {
|
||||
clsx,
|
||||
clsx_default
|
||||
};
|
||||
//# sourceMappingURL=chunk-SIU35MPB.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-SIU35MPB.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-SIU35MPB.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"],
|
||||
"sourcesContent": ["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],
|
||||
"mappings": ";AAAA,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,OAAK,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAC,IAAO,eAAQ;",
|
||||
"names": []
|
||||
}
|
||||
1004
canvas-demo/node_modules/.vite/deps/chunk-T3SJLYUH.js
generated
vendored
Normal file
1004
canvas-demo/node_modules/.vite/deps/chunk-T3SJLYUH.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/chunk-T3SJLYUH.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-T3SJLYUH.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
292
canvas-demo/node_modules/.vite/deps/chunk-YAGB2RBV.js
generated
vendored
Normal file
292
canvas-demo/node_modules/.vite/deps/chunk-YAGB2RBV.js
generated
vendored
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
import {
|
||||
require_react
|
||||
} from "./chunk-T3SJLYUH.js";
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.development.js
|
||||
var require_react_jsx_runtime_development = __commonJS({
|
||||
"../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
||||
"use strict";
|
||||
(function() {
|
||||
function getComponentNameFromType(type) {
|
||||
if (null == type) return null;
|
||||
if ("function" === typeof type)
|
||||
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||
if ("string" === typeof type) return type;
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE:
|
||||
return "Fragment";
|
||||
case REACT_PROFILER_TYPE:
|
||||
return "Profiler";
|
||||
case REACT_STRICT_MODE_TYPE:
|
||||
return "StrictMode";
|
||||
case REACT_SUSPENSE_TYPE:
|
||||
return "Suspense";
|
||||
case REACT_SUSPENSE_LIST_TYPE:
|
||||
return "SuspenseList";
|
||||
case REACT_ACTIVITY_TYPE:
|
||||
return "Activity";
|
||||
}
|
||||
if ("object" === typeof type)
|
||||
switch ("number" === typeof type.tag && console.error(
|
||||
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
||||
), type.$$typeof) {
|
||||
case REACT_PORTAL_TYPE:
|
||||
return "Portal";
|
||||
case REACT_CONTEXT_TYPE:
|
||||
return type.displayName || "Context";
|
||||
case REACT_CONSUMER_TYPE:
|
||||
return (type._context.displayName || "Context") + ".Consumer";
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
var innerType = type.render;
|
||||
type = type.displayName;
|
||||
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||
return type;
|
||||
case REACT_MEMO_TYPE:
|
||||
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||
case REACT_LAZY_TYPE:
|
||||
innerType = type._payload;
|
||||
type = type._init;
|
||||
try {
|
||||
return getComponentNameFromType(type(innerType));
|
||||
} catch (x) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function checkKeyStringCoercion(value) {
|
||||
try {
|
||||
testStringCoercion(value);
|
||||
var JSCompiler_inline_result = false;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = true;
|
||||
}
|
||||
if (JSCompiler_inline_result) {
|
||||
JSCompiler_inline_result = console;
|
||||
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||
JSCompiler_temp_const.call(
|
||||
JSCompiler_inline_result,
|
||||
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||
JSCompiler_inline_result$jscomp$0
|
||||
);
|
||||
return testStringCoercion(value);
|
||||
}
|
||||
}
|
||||
function getTaskName(type) {
|
||||
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
||||
return "<...>";
|
||||
try {
|
||||
var name = getComponentNameFromType(type);
|
||||
return name ? "<" + name + ">" : "<...>";
|
||||
} catch (x) {
|
||||
return "<...>";
|
||||
}
|
||||
}
|
||||
function getOwner() {
|
||||
var dispatcher = ReactSharedInternals.A;
|
||||
return null === dispatcher ? null : dispatcher.getOwner();
|
||||
}
|
||||
function UnknownOwner() {
|
||||
return Error("react-stack-top-frame");
|
||||
}
|
||||
function hasValidKey(config) {
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||
if (getter && getter.isReactWarning) return false;
|
||||
}
|
||||
return void 0 !== config.key;
|
||||
}
|
||||
function defineKeyPropWarningGetter(props, displayName) {
|
||||
function warnAboutAccessingKey() {
|
||||
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
||||
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
||||
displayName
|
||||
));
|
||||
}
|
||||
warnAboutAccessingKey.isReactWarning = true;
|
||||
Object.defineProperty(props, "key", {
|
||||
get: warnAboutAccessingKey,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function elementRefGetterWithDeprecationWarning() {
|
||||
var componentName = getComponentNameFromType(this.type);
|
||||
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
||||
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
||||
));
|
||||
componentName = this.props.ref;
|
||||
return void 0 !== componentName ? componentName : null;
|
||||
}
|
||||
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
||||
var refProp = props.ref;
|
||||
type = {
|
||||
$$typeof: REACT_ELEMENT_TYPE,
|
||||
type,
|
||||
key,
|
||||
props,
|
||||
_owner: owner
|
||||
};
|
||||
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
||||
enumerable: false,
|
||||
get: elementRefGetterWithDeprecationWarning
|
||||
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
||||
type._store = {};
|
||||
Object.defineProperty(type._store, "validated", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: 0
|
||||
});
|
||||
Object.defineProperty(type, "_debugInfo", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: null
|
||||
});
|
||||
Object.defineProperty(type, "_debugStack", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugStack
|
||||
});
|
||||
Object.defineProperty(type, "_debugTask", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugTask
|
||||
});
|
||||
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||
return type;
|
||||
}
|
||||
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
||||
var children = config.children;
|
||||
if (void 0 !== children)
|
||||
if (isStaticChildren)
|
||||
if (isArrayImpl(children)) {
|
||||
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
||||
validateChildKeys(children[isStaticChildren]);
|
||||
Object.freeze && Object.freeze(children);
|
||||
} else
|
||||
console.error(
|
||||
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
||||
);
|
||||
else validateChildKeys(children);
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
children = getComponentNameFromType(type);
|
||||
var keys = Object.keys(config).filter(function(k) {
|
||||
return "key" !== k;
|
||||
});
|
||||
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
||||
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
||||
isStaticChildren,
|
||||
children,
|
||||
keys,
|
||||
children
|
||||
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
||||
}
|
||||
children = null;
|
||||
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||
if ("key" in config) {
|
||||
maybeKey = {};
|
||||
for (var propName in config)
|
||||
"key" !== propName && (maybeKey[propName] = config[propName]);
|
||||
} else maybeKey = config;
|
||||
children && defineKeyPropWarningGetter(
|
||||
maybeKey,
|
||||
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
||||
);
|
||||
return ReactElement(
|
||||
type,
|
||||
children,
|
||||
maybeKey,
|
||||
getOwner(),
|
||||
debugStack,
|
||||
debugTask
|
||||
);
|
||||
}
|
||||
function validateChildKeys(node) {
|
||||
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
||||
}
|
||||
function isValidElement(object) {
|
||||
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||
}
|
||||
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||
return null;
|
||||
};
|
||||
React = {
|
||||
react_stack_bottom_frame: function(callStackForError) {
|
||||
return callStackForError();
|
||||
}
|
||||
};
|
||||
var specialPropKeyWarningShown;
|
||||
var didWarnAboutElementRef = {};
|
||||
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
||||
React,
|
||||
UnknownOwner
|
||||
)();
|
||||
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||
var didWarnAboutKeySpread = {};
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.jsx = function(type, config, maybeKey) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
return jsxDEVImpl(
|
||||
type,
|
||||
config,
|
||||
maybeKey,
|
||||
false,
|
||||
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||
);
|
||||
};
|
||||
exports.jsxs = function(type, config, maybeKey) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
return jsxDEVImpl(
|
||||
type,
|
||||
config,
|
||||
maybeKey,
|
||||
true,
|
||||
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||
);
|
||||
};
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// ../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js
|
||||
var require_jsx_runtime = __commonJS({
|
||||
"../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js"(exports, module) {
|
||||
if (false) {
|
||||
module.exports = null;
|
||||
} else {
|
||||
module.exports = require_react_jsx_runtime_development();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
require_jsx_runtime
|
||||
};
|
||||
/*! Bundled license information:
|
||||
|
||||
react/cjs/react-jsx-runtime.development.js:
|
||||
(**
|
||||
* @license React
|
||||
* react-jsx-runtime.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
*/
|
||||
//# sourceMappingURL=chunk-YAGB2RBV.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/chunk-YAGB2RBV.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/chunk-YAGB2RBV.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
canvas-demo/node_modules/.vite/deps/class-variance-authority.js
generated
vendored
Normal file
10
canvas-demo/node_modules/.vite/deps/class-variance-authority.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import {
|
||||
cva,
|
||||
cx
|
||||
} from "./chunk-5DYWO4C6.js";
|
||||
import "./chunk-SIU35MPB.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export {
|
||||
cva,
|
||||
cx
|
||||
};
|
||||
7
canvas-demo/node_modules/.vite/deps/class-variance-authority.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/class-variance-authority.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
9
canvas-demo/node_modules/.vite/deps/clsx.js
generated
vendored
Normal file
9
canvas-demo/node_modules/.vite/deps/clsx.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import {
|
||||
clsx,
|
||||
clsx_default
|
||||
} from "./chunk-SIU35MPB.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export {
|
||||
clsx,
|
||||
clsx_default as default
|
||||
};
|
||||
7
canvas-demo/node_modules/.vite/deps/clsx.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/clsx.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
975
canvas-demo/node_modules/.vite/deps/d3-force.js
generated
vendored
Normal file
975
canvas-demo/node_modules/.vite/deps/d3-force.js
generated
vendored
Normal file
|
|
@ -0,0 +1,975 @@
|
|||
import "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/center.js
|
||||
function center_default(x3, y3) {
|
||||
var nodes, strength = 1;
|
||||
if (x3 == null) x3 = 0;
|
||||
if (y3 == null) y3 = 0;
|
||||
function force() {
|
||||
var i, n = nodes.length, node, sx = 0, sy = 0;
|
||||
for (i = 0; i < n; ++i) {
|
||||
node = nodes[i], sx += node.x, sy += node.y;
|
||||
}
|
||||
for (sx = (sx / n - x3) * strength, sy = (sy / n - y3) * strength, i = 0; i < n; ++i) {
|
||||
node = nodes[i], node.x -= sx, node.y -= sy;
|
||||
}
|
||||
}
|
||||
force.initialize = function(_) {
|
||||
nodes = _;
|
||||
};
|
||||
force.x = function(_) {
|
||||
return arguments.length ? (x3 = +_, force) : x3;
|
||||
};
|
||||
force.y = function(_) {
|
||||
return arguments.length ? (y3 = +_, force) : y3;
|
||||
};
|
||||
force.strength = function(_) {
|
||||
return arguments.length ? (strength = +_, force) : strength;
|
||||
};
|
||||
return force;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/add.js
|
||||
function add_default(d) {
|
||||
const x3 = +this._x.call(null, d), y3 = +this._y.call(null, d);
|
||||
return add(this.cover(x3, y3), x3, y3, d);
|
||||
}
|
||||
function add(tree, x3, y3, d) {
|
||||
if (isNaN(x3) || isNaN(y3)) return tree;
|
||||
var parent, node = tree._root, leaf = { data: d }, x0 = tree._x0, y0 = tree._y0, x1 = tree._x1, y1 = tree._y1, xm, ym, xp, yp, right, bottom, i, j;
|
||||
if (!node) return tree._root = leaf, tree;
|
||||
while (node.length) {
|
||||
if (right = x3 >= (xm = (x0 + x1) / 2)) x0 = xm;
|
||||
else x1 = xm;
|
||||
if (bottom = y3 >= (ym = (y0 + y1) / 2)) y0 = ym;
|
||||
else y1 = ym;
|
||||
if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;
|
||||
}
|
||||
xp = +tree._x.call(null, node.data);
|
||||
yp = +tree._y.call(null, node.data);
|
||||
if (x3 === xp && y3 === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
|
||||
do {
|
||||
parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);
|
||||
if (right = x3 >= (xm = (x0 + x1) / 2)) x0 = xm;
|
||||
else x1 = xm;
|
||||
if (bottom = y3 >= (ym = (y0 + y1) / 2)) y0 = ym;
|
||||
else y1 = ym;
|
||||
} while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | xp >= xm));
|
||||
return parent[j] = node, parent[i] = leaf, tree;
|
||||
}
|
||||
function addAll(data) {
|
||||
var d, i, n = data.length, x3, y3, xz = new Array(n), yz = new Array(n), x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
|
||||
for (i = 0; i < n; ++i) {
|
||||
if (isNaN(x3 = +this._x.call(null, d = data[i])) || isNaN(y3 = +this._y.call(null, d))) continue;
|
||||
xz[i] = x3;
|
||||
yz[i] = y3;
|
||||
if (x3 < x0) x0 = x3;
|
||||
if (x3 > x1) x1 = x3;
|
||||
if (y3 < y0) y0 = y3;
|
||||
if (y3 > y1) y1 = y3;
|
||||
}
|
||||
if (x0 > x1 || y0 > y1) return this;
|
||||
this.cover(x0, y0).cover(x1, y1);
|
||||
for (i = 0; i < n; ++i) {
|
||||
add(this, xz[i], yz[i], data[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/cover.js
|
||||
function cover_default(x3, y3) {
|
||||
if (isNaN(x3 = +x3) || isNaN(y3 = +y3)) return this;
|
||||
var x0 = this._x0, y0 = this._y0, x1 = this._x1, y1 = this._y1;
|
||||
if (isNaN(x0)) {
|
||||
x1 = (x0 = Math.floor(x3)) + 1;
|
||||
y1 = (y0 = Math.floor(y3)) + 1;
|
||||
} else {
|
||||
var z = x1 - x0 || 1, node = this._root, parent, i;
|
||||
while (x0 > x3 || x3 >= x1 || y0 > y3 || y3 >= y1) {
|
||||
i = (y3 < y0) << 1 | x3 < x0;
|
||||
parent = new Array(4), parent[i] = node, node = parent, z *= 2;
|
||||
switch (i) {
|
||||
case 0:
|
||||
x1 = x0 + z, y1 = y0 + z;
|
||||
break;
|
||||
case 1:
|
||||
x0 = x1 - z, y1 = y0 + z;
|
||||
break;
|
||||
case 2:
|
||||
x1 = x0 + z, y0 = y1 - z;
|
||||
break;
|
||||
case 3:
|
||||
x0 = x1 - z, y0 = y1 - z;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this._root && this._root.length) this._root = node;
|
||||
}
|
||||
this._x0 = x0;
|
||||
this._y0 = y0;
|
||||
this._x1 = x1;
|
||||
this._y1 = y1;
|
||||
return this;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/data.js
|
||||
function data_default() {
|
||||
var data = [];
|
||||
this.visit(function(node) {
|
||||
if (!node.length) do
|
||||
data.push(node.data);
|
||||
while (node = node.next);
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/extent.js
|
||||
function extent_default(_) {
|
||||
return arguments.length ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]];
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/quad.js
|
||||
function quad_default(node, x0, y0, x1, y1) {
|
||||
this.node = node;
|
||||
this.x0 = x0;
|
||||
this.y0 = y0;
|
||||
this.x1 = x1;
|
||||
this.y1 = y1;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/find.js
|
||||
function find_default(x3, y3, radius) {
|
||||
var data, x0 = this._x0, y0 = this._y0, x1, y1, x22, y22, x32 = this._x1, y32 = this._y1, quads = [], node = this._root, q, i;
|
||||
if (node) quads.push(new quad_default(node, x0, y0, x32, y32));
|
||||
if (radius == null) radius = Infinity;
|
||||
else {
|
||||
x0 = x3 - radius, y0 = y3 - radius;
|
||||
x32 = x3 + radius, y32 = y3 + radius;
|
||||
radius *= radius;
|
||||
}
|
||||
while (q = quads.pop()) {
|
||||
if (!(node = q.node) || (x1 = q.x0) > x32 || (y1 = q.y0) > y32 || (x22 = q.x1) < x0 || (y22 = q.y1) < y0) continue;
|
||||
if (node.length) {
|
||||
var xm = (x1 + x22) / 2, ym = (y1 + y22) / 2;
|
||||
quads.push(
|
||||
new quad_default(node[3], xm, ym, x22, y22),
|
||||
new quad_default(node[2], x1, ym, xm, y22),
|
||||
new quad_default(node[1], xm, y1, x22, ym),
|
||||
new quad_default(node[0], x1, y1, xm, ym)
|
||||
);
|
||||
if (i = (y3 >= ym) << 1 | x3 >= xm) {
|
||||
q = quads[quads.length - 1];
|
||||
quads[quads.length - 1] = quads[quads.length - 1 - i];
|
||||
quads[quads.length - 1 - i] = q;
|
||||
}
|
||||
} else {
|
||||
var dx = x3 - +this._x.call(null, node.data), dy = y3 - +this._y.call(null, node.data), d2 = dx * dx + dy * dy;
|
||||
if (d2 < radius) {
|
||||
var d = Math.sqrt(radius = d2);
|
||||
x0 = x3 - d, y0 = y3 - d;
|
||||
x32 = x3 + d, y32 = y3 + d;
|
||||
data = node.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/remove.js
|
||||
function remove_default(d) {
|
||||
if (isNaN(x3 = +this._x.call(null, d)) || isNaN(y3 = +this._y.call(null, d))) return this;
|
||||
var parent, node = this._root, retainer, previous, next, x0 = this._x0, y0 = this._y0, x1 = this._x1, y1 = this._y1, x3, y3, xm, ym, right, bottom, i, j;
|
||||
if (!node) return this;
|
||||
if (node.length) while (true) {
|
||||
if (right = x3 >= (xm = (x0 + x1) / 2)) x0 = xm;
|
||||
else x1 = xm;
|
||||
if (bottom = y3 >= (ym = (y0 + y1) / 2)) y0 = ym;
|
||||
else y1 = ym;
|
||||
if (!(parent = node, node = node[i = bottom << 1 | right])) return this;
|
||||
if (!node.length) break;
|
||||
if (parent[i + 1 & 3] || parent[i + 2 & 3] || parent[i + 3 & 3]) retainer = parent, j = i;
|
||||
}
|
||||
while (node.data !== d) if (!(previous = node, node = node.next)) return this;
|
||||
if (next = node.next) delete node.next;
|
||||
if (previous) return next ? previous.next = next : delete previous.next, this;
|
||||
if (!parent) return this._root = next, this;
|
||||
next ? parent[i] = next : delete parent[i];
|
||||
if ((node = parent[0] || parent[1] || parent[2] || parent[3]) && node === (parent[3] || parent[2] || parent[1] || parent[0]) && !node.length) {
|
||||
if (retainer) retainer[j] = node;
|
||||
else this._root = node;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
function removeAll(data) {
|
||||
for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
|
||||
return this;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/root.js
|
||||
function root_default() {
|
||||
return this._root;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/size.js
|
||||
function size_default() {
|
||||
var size = 0;
|
||||
this.visit(function(node) {
|
||||
if (!node.length) do
|
||||
++size;
|
||||
while (node = node.next);
|
||||
});
|
||||
return size;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/visit.js
|
||||
function visit_default(callback) {
|
||||
var quads = [], q, node = this._root, child, x0, y0, x1, y1;
|
||||
if (node) quads.push(new quad_default(node, this._x0, this._y0, this._x1, this._y1));
|
||||
while (q = quads.pop()) {
|
||||
if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {
|
||||
var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
|
||||
if (child = node[3]) quads.push(new quad_default(child, xm, ym, x1, y1));
|
||||
if (child = node[2]) quads.push(new quad_default(child, x0, ym, xm, y1));
|
||||
if (child = node[1]) quads.push(new quad_default(child, xm, y0, x1, ym));
|
||||
if (child = node[0]) quads.push(new quad_default(child, x0, y0, xm, ym));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/visitAfter.js
|
||||
function visitAfter_default(callback) {
|
||||
var quads = [], next = [], q;
|
||||
if (this._root) quads.push(new quad_default(this._root, this._x0, this._y0, this._x1, this._y1));
|
||||
while (q = quads.pop()) {
|
||||
var node = q.node;
|
||||
if (node.length) {
|
||||
var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
|
||||
if (child = node[0]) quads.push(new quad_default(child, x0, y0, xm, ym));
|
||||
if (child = node[1]) quads.push(new quad_default(child, xm, y0, x1, ym));
|
||||
if (child = node[2]) quads.push(new quad_default(child, x0, ym, xm, y1));
|
||||
if (child = node[3]) quads.push(new quad_default(child, xm, ym, x1, y1));
|
||||
}
|
||||
next.push(q);
|
||||
}
|
||||
while (q = next.pop()) {
|
||||
callback(q.node, q.x0, q.y0, q.x1, q.y1);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/x.js
|
||||
function defaultX(d) {
|
||||
return d[0];
|
||||
}
|
||||
function x_default(_) {
|
||||
return arguments.length ? (this._x = _, this) : this._x;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/y.js
|
||||
function defaultY(d) {
|
||||
return d[1];
|
||||
}
|
||||
function y_default(_) {
|
||||
return arguments.length ? (this._y = _, this) : this._y;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-quadtree@3.0.1/node_modules/d3-quadtree/src/quadtree.js
|
||||
function quadtree(nodes, x3, y3) {
|
||||
var tree = new Quadtree(x3 == null ? defaultX : x3, y3 == null ? defaultY : y3, NaN, NaN, NaN, NaN);
|
||||
return nodes == null ? tree : tree.addAll(nodes);
|
||||
}
|
||||
function Quadtree(x3, y3, x0, y0, x1, y1) {
|
||||
this._x = x3;
|
||||
this._y = y3;
|
||||
this._x0 = x0;
|
||||
this._y0 = y0;
|
||||
this._x1 = x1;
|
||||
this._y1 = y1;
|
||||
this._root = void 0;
|
||||
}
|
||||
function leaf_copy(leaf) {
|
||||
var copy = { data: leaf.data }, next = copy;
|
||||
while (leaf = leaf.next) next = next.next = { data: leaf.data };
|
||||
return copy;
|
||||
}
|
||||
var treeProto = quadtree.prototype = Quadtree.prototype;
|
||||
treeProto.copy = function() {
|
||||
var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1), node = this._root, nodes, child;
|
||||
if (!node) return copy;
|
||||
if (!node.length) return copy._root = leaf_copy(node), copy;
|
||||
nodes = [{ source: node, target: copy._root = new Array(4) }];
|
||||
while (node = nodes.pop()) {
|
||||
for (var i = 0; i < 4; ++i) {
|
||||
if (child = node.source[i]) {
|
||||
if (child.length) nodes.push({ source: child, target: node.target[i] = new Array(4) });
|
||||
else node.target[i] = leaf_copy(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
return copy;
|
||||
};
|
||||
treeProto.add = add_default;
|
||||
treeProto.addAll = addAll;
|
||||
treeProto.cover = cover_default;
|
||||
treeProto.data = data_default;
|
||||
treeProto.extent = extent_default;
|
||||
treeProto.find = find_default;
|
||||
treeProto.remove = remove_default;
|
||||
treeProto.removeAll = removeAll;
|
||||
treeProto.root = root_default;
|
||||
treeProto.size = size_default;
|
||||
treeProto.visit = visit_default;
|
||||
treeProto.visitAfter = visitAfter_default;
|
||||
treeProto.x = x_default;
|
||||
treeProto.y = y_default;
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/constant.js
|
||||
function constant_default(x3) {
|
||||
return function() {
|
||||
return x3;
|
||||
};
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/jiggle.js
|
||||
function jiggle_default(random) {
|
||||
return (random() - 0.5) * 1e-6;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/collide.js
|
||||
function x(d) {
|
||||
return d.x + d.vx;
|
||||
}
|
||||
function y(d) {
|
||||
return d.y + d.vy;
|
||||
}
|
||||
function collide_default(radius) {
|
||||
var nodes, radii, random, strength = 1, iterations = 1;
|
||||
if (typeof radius !== "function") radius = constant_default(radius == null ? 1 : +radius);
|
||||
function force() {
|
||||
var i, n = nodes.length, tree, node, xi, yi, ri, ri2;
|
||||
for (var k = 0; k < iterations; ++k) {
|
||||
tree = quadtree(nodes, x, y).visitAfter(prepare);
|
||||
for (i = 0; i < n; ++i) {
|
||||
node = nodes[i];
|
||||
ri = radii[node.index], ri2 = ri * ri;
|
||||
xi = node.x + node.vx;
|
||||
yi = node.y + node.vy;
|
||||
tree.visit(apply);
|
||||
}
|
||||
}
|
||||
function apply(quad, x0, y0, x1, y1) {
|
||||
var data = quad.data, rj = quad.r, r = ri + rj;
|
||||
if (data) {
|
||||
if (data.index > node.index) {
|
||||
var x3 = xi - data.x - data.vx, y3 = yi - data.y - data.vy, l = x3 * x3 + y3 * y3;
|
||||
if (l < r * r) {
|
||||
if (x3 === 0) x3 = jiggle_default(random), l += x3 * x3;
|
||||
if (y3 === 0) y3 = jiggle_default(random), l += y3 * y3;
|
||||
l = (r - (l = Math.sqrt(l))) / l * strength;
|
||||
node.vx += (x3 *= l) * (r = (rj *= rj) / (ri2 + rj));
|
||||
node.vy += (y3 *= l) * r;
|
||||
data.vx -= x3 * (r = 1 - r);
|
||||
data.vy -= y3 * r;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;
|
||||
}
|
||||
}
|
||||
function prepare(quad) {
|
||||
if (quad.data) return quad.r = radii[quad.data.index];
|
||||
for (var i = quad.r = 0; i < 4; ++i) {
|
||||
if (quad[i] && quad[i].r > quad.r) {
|
||||
quad.r = quad[i].r;
|
||||
}
|
||||
}
|
||||
}
|
||||
function initialize() {
|
||||
if (!nodes) return;
|
||||
var i, n = nodes.length, node;
|
||||
radii = new Array(n);
|
||||
for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);
|
||||
}
|
||||
force.initialize = function(_nodes, _random) {
|
||||
nodes = _nodes;
|
||||
random = _random;
|
||||
initialize();
|
||||
};
|
||||
force.iterations = function(_) {
|
||||
return arguments.length ? (iterations = +_, force) : iterations;
|
||||
};
|
||||
force.strength = function(_) {
|
||||
return arguments.length ? (strength = +_, force) : strength;
|
||||
};
|
||||
force.radius = function(_) {
|
||||
return arguments.length ? (radius = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : radius;
|
||||
};
|
||||
return force;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/link.js
|
||||
function index(d) {
|
||||
return d.index;
|
||||
}
|
||||
function find(nodeById, nodeId) {
|
||||
var node = nodeById.get(nodeId);
|
||||
if (!node) throw new Error("node not found: " + nodeId);
|
||||
return node;
|
||||
}
|
||||
function link_default(links) {
|
||||
var id = index, strength = defaultStrength, strengths, distance = constant_default(30), distances, nodes, count, bias, random, iterations = 1;
|
||||
if (links == null) links = [];
|
||||
function defaultStrength(link) {
|
||||
return 1 / Math.min(count[link.source.index], count[link.target.index]);
|
||||
}
|
||||
function force(alpha) {
|
||||
for (var k = 0, n = links.length; k < iterations; ++k) {
|
||||
for (var i = 0, link, source, target, x3, y3, l, b; i < n; ++i) {
|
||||
link = links[i], source = link.source, target = link.target;
|
||||
x3 = target.x + target.vx - source.x - source.vx || jiggle_default(random);
|
||||
y3 = target.y + target.vy - source.y - source.vy || jiggle_default(random);
|
||||
l = Math.sqrt(x3 * x3 + y3 * y3);
|
||||
l = (l - distances[i]) / l * alpha * strengths[i];
|
||||
x3 *= l, y3 *= l;
|
||||
target.vx -= x3 * (b = bias[i]);
|
||||
target.vy -= y3 * b;
|
||||
source.vx += x3 * (b = 1 - b);
|
||||
source.vy += y3 * b;
|
||||
}
|
||||
}
|
||||
}
|
||||
function initialize() {
|
||||
if (!nodes) return;
|
||||
var i, n = nodes.length, m2 = links.length, nodeById = new Map(nodes.map((d, i2) => [id(d, i2, nodes), d])), link;
|
||||
for (i = 0, count = new Array(n); i < m2; ++i) {
|
||||
link = links[i], link.index = i;
|
||||
if (typeof link.source !== "object") link.source = find(nodeById, link.source);
|
||||
if (typeof link.target !== "object") link.target = find(nodeById, link.target);
|
||||
count[link.source.index] = (count[link.source.index] || 0) + 1;
|
||||
count[link.target.index] = (count[link.target.index] || 0) + 1;
|
||||
}
|
||||
for (i = 0, bias = new Array(m2); i < m2; ++i) {
|
||||
link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);
|
||||
}
|
||||
strengths = new Array(m2), initializeStrength();
|
||||
distances = new Array(m2), initializeDistance();
|
||||
}
|
||||
function initializeStrength() {
|
||||
if (!nodes) return;
|
||||
for (var i = 0, n = links.length; i < n; ++i) {
|
||||
strengths[i] = +strength(links[i], i, links);
|
||||
}
|
||||
}
|
||||
function initializeDistance() {
|
||||
if (!nodes) return;
|
||||
for (var i = 0, n = links.length; i < n; ++i) {
|
||||
distances[i] = +distance(links[i], i, links);
|
||||
}
|
||||
}
|
||||
force.initialize = function(_nodes, _random) {
|
||||
nodes = _nodes;
|
||||
random = _random;
|
||||
initialize();
|
||||
};
|
||||
force.links = function(_) {
|
||||
return arguments.length ? (links = _, initialize(), force) : links;
|
||||
};
|
||||
force.id = function(_) {
|
||||
return arguments.length ? (id = _, force) : id;
|
||||
};
|
||||
force.iterations = function(_) {
|
||||
return arguments.length ? (iterations = +_, force) : iterations;
|
||||
};
|
||||
force.strength = function(_) {
|
||||
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default(+_), initializeStrength(), force) : strength;
|
||||
};
|
||||
force.distance = function(_) {
|
||||
return arguments.length ? (distance = typeof _ === "function" ? _ : constant_default(+_), initializeDistance(), force) : distance;
|
||||
};
|
||||
return force;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js
|
||||
var noop = { value: () => {
|
||||
} };
|
||||
function dispatch() {
|
||||
for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
|
||||
if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t);
|
||||
_[t] = [];
|
||||
}
|
||||
return new Dispatch(_);
|
||||
}
|
||||
function Dispatch(_) {
|
||||
this._ = _;
|
||||
}
|
||||
function parseTypenames(typenames, types) {
|
||||
return typenames.trim().split(/^|\s+/).map(function(t) {
|
||||
var name = "", i = t.indexOf(".");
|
||||
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
|
||||
if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
|
||||
return { type: t, name };
|
||||
});
|
||||
}
|
||||
Dispatch.prototype = dispatch.prototype = {
|
||||
constructor: Dispatch,
|
||||
on: function(typename, callback) {
|
||||
var _ = this._, T = parseTypenames(typename + "", _), t, i = -1, n = T.length;
|
||||
if (arguments.length < 2) {
|
||||
while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
|
||||
return;
|
||||
}
|
||||
if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
|
||||
while (++i < n) {
|
||||
if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);
|
||||
else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
copy: function() {
|
||||
var copy = {}, _ = this._;
|
||||
for (var t in _) copy[t] = _[t].slice();
|
||||
return new Dispatch(copy);
|
||||
},
|
||||
call: function(type, that) {
|
||||
if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];
|
||||
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
||||
for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
|
||||
},
|
||||
apply: function(type, that, args) {
|
||||
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
||||
for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
|
||||
}
|
||||
};
|
||||
function get(type, name) {
|
||||
for (var i = 0, n = type.length, c2; i < n; ++i) {
|
||||
if ((c2 = type[i]).name === name) {
|
||||
return c2.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
function set(type, name, callback) {
|
||||
for (var i = 0, n = type.length; i < n; ++i) {
|
||||
if (type[i].name === name) {
|
||||
type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (callback != null) type.push({ name, value: callback });
|
||||
return type;
|
||||
}
|
||||
var dispatch_default = dispatch;
|
||||
|
||||
// ../../node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js
|
||||
var frame = 0;
|
||||
var timeout = 0;
|
||||
var interval = 0;
|
||||
var pokeDelay = 1e3;
|
||||
var taskHead;
|
||||
var taskTail;
|
||||
var clockLast = 0;
|
||||
var clockNow = 0;
|
||||
var clockSkew = 0;
|
||||
var clock = typeof performance === "object" && performance.now ? performance : Date;
|
||||
var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
|
||||
setTimeout(f, 17);
|
||||
};
|
||||
function now() {
|
||||
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
||||
}
|
||||
function clearNow() {
|
||||
clockNow = 0;
|
||||
}
|
||||
function Timer() {
|
||||
this._call = this._time = this._next = null;
|
||||
}
|
||||
Timer.prototype = timer.prototype = {
|
||||
constructor: Timer,
|
||||
restart: function(callback, delay, time) {
|
||||
if (typeof callback !== "function") throw new TypeError("callback is not a function");
|
||||
time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
|
||||
if (!this._next && taskTail !== this) {
|
||||
if (taskTail) taskTail._next = this;
|
||||
else taskHead = this;
|
||||
taskTail = this;
|
||||
}
|
||||
this._call = callback;
|
||||
this._time = time;
|
||||
sleep();
|
||||
},
|
||||
stop: function() {
|
||||
if (this._call) {
|
||||
this._call = null;
|
||||
this._time = Infinity;
|
||||
sleep();
|
||||
}
|
||||
}
|
||||
};
|
||||
function timer(callback, delay, time) {
|
||||
var t = new Timer();
|
||||
t.restart(callback, delay, time);
|
||||
return t;
|
||||
}
|
||||
function timerFlush() {
|
||||
now();
|
||||
++frame;
|
||||
var t = taskHead, e;
|
||||
while (t) {
|
||||
if ((e = clockNow - t._time) >= 0) t._call.call(void 0, e);
|
||||
t = t._next;
|
||||
}
|
||||
--frame;
|
||||
}
|
||||
function wake() {
|
||||
clockNow = (clockLast = clock.now()) + clockSkew;
|
||||
frame = timeout = 0;
|
||||
try {
|
||||
timerFlush();
|
||||
} finally {
|
||||
frame = 0;
|
||||
nap();
|
||||
clockNow = 0;
|
||||
}
|
||||
}
|
||||
function poke() {
|
||||
var now2 = clock.now(), delay = now2 - clockLast;
|
||||
if (delay > pokeDelay) clockSkew -= delay, clockLast = now2;
|
||||
}
|
||||
function nap() {
|
||||
var t0, t1 = taskHead, t2, time = Infinity;
|
||||
while (t1) {
|
||||
if (t1._call) {
|
||||
if (time > t1._time) time = t1._time;
|
||||
t0 = t1, t1 = t1._next;
|
||||
} else {
|
||||
t2 = t1._next, t1._next = null;
|
||||
t1 = t0 ? t0._next = t2 : taskHead = t2;
|
||||
}
|
||||
}
|
||||
taskTail = t0;
|
||||
sleep(time);
|
||||
}
|
||||
function sleep(time) {
|
||||
if (frame) return;
|
||||
if (timeout) timeout = clearTimeout(timeout);
|
||||
var delay = time - clockNow;
|
||||
if (delay > 24) {
|
||||
if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
|
||||
if (interval) interval = clearInterval(interval);
|
||||
} else {
|
||||
if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
|
||||
frame = 1, setFrame(wake);
|
||||
}
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/lcg.js
|
||||
var a = 1664525;
|
||||
var c = 1013904223;
|
||||
var m = 4294967296;
|
||||
function lcg_default() {
|
||||
let s = 1;
|
||||
return () => (s = (a * s + c) % m) / m;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/simulation.js
|
||||
function x2(d) {
|
||||
return d.x;
|
||||
}
|
||||
function y2(d) {
|
||||
return d.y;
|
||||
}
|
||||
var initialRadius = 10;
|
||||
var initialAngle = Math.PI * (3 - Math.sqrt(5));
|
||||
function simulation_default(nodes) {
|
||||
var simulation, alpha = 1, alphaMin = 1e-3, alphaDecay = 1 - Math.pow(alphaMin, 1 / 300), alphaTarget = 0, velocityDecay = 0.6, forces = /* @__PURE__ */ new Map(), stepper = timer(step), event = dispatch_default("tick", "end"), random = lcg_default();
|
||||
if (nodes == null) nodes = [];
|
||||
function step() {
|
||||
tick();
|
||||
event.call("tick", simulation);
|
||||
if (alpha < alphaMin) {
|
||||
stepper.stop();
|
||||
event.call("end", simulation);
|
||||
}
|
||||
}
|
||||
function tick(iterations) {
|
||||
var i, n = nodes.length, node;
|
||||
if (iterations === void 0) iterations = 1;
|
||||
for (var k = 0; k < iterations; ++k) {
|
||||
alpha += (alphaTarget - alpha) * alphaDecay;
|
||||
forces.forEach(function(force) {
|
||||
force(alpha);
|
||||
});
|
||||
for (i = 0; i < n; ++i) {
|
||||
node = nodes[i];
|
||||
if (node.fx == null) node.x += node.vx *= velocityDecay;
|
||||
else node.x = node.fx, node.vx = 0;
|
||||
if (node.fy == null) node.y += node.vy *= velocityDecay;
|
||||
else node.y = node.fy, node.vy = 0;
|
||||
}
|
||||
}
|
||||
return simulation;
|
||||
}
|
||||
function initializeNodes() {
|
||||
for (var i = 0, n = nodes.length, node; i < n; ++i) {
|
||||
node = nodes[i], node.index = i;
|
||||
if (node.fx != null) node.x = node.fx;
|
||||
if (node.fy != null) node.y = node.fy;
|
||||
if (isNaN(node.x) || isNaN(node.y)) {
|
||||
var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;
|
||||
node.x = radius * Math.cos(angle);
|
||||
node.y = radius * Math.sin(angle);
|
||||
}
|
||||
if (isNaN(node.vx) || isNaN(node.vy)) {
|
||||
node.vx = node.vy = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
function initializeForce(force) {
|
||||
if (force.initialize) force.initialize(nodes, random);
|
||||
return force;
|
||||
}
|
||||
initializeNodes();
|
||||
return simulation = {
|
||||
tick,
|
||||
restart: function() {
|
||||
return stepper.restart(step), simulation;
|
||||
},
|
||||
stop: function() {
|
||||
return stepper.stop(), simulation;
|
||||
},
|
||||
nodes: function(_) {
|
||||
return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;
|
||||
},
|
||||
alpha: function(_) {
|
||||
return arguments.length ? (alpha = +_, simulation) : alpha;
|
||||
},
|
||||
alphaMin: function(_) {
|
||||
return arguments.length ? (alphaMin = +_, simulation) : alphaMin;
|
||||
},
|
||||
alphaDecay: function(_) {
|
||||
return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;
|
||||
},
|
||||
alphaTarget: function(_) {
|
||||
return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;
|
||||
},
|
||||
velocityDecay: function(_) {
|
||||
return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;
|
||||
},
|
||||
randomSource: function(_) {
|
||||
return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;
|
||||
},
|
||||
force: function(name, _) {
|
||||
return arguments.length > 1 ? (_ == null ? forces.delete(name) : forces.set(name, initializeForce(_)), simulation) : forces.get(name);
|
||||
},
|
||||
find: function(x3, y3, radius) {
|
||||
var i = 0, n = nodes.length, dx, dy, d2, node, closest;
|
||||
if (radius == null) radius = Infinity;
|
||||
else radius *= radius;
|
||||
for (i = 0; i < n; ++i) {
|
||||
node = nodes[i];
|
||||
dx = x3 - node.x;
|
||||
dy = y3 - node.y;
|
||||
d2 = dx * dx + dy * dy;
|
||||
if (d2 < radius) closest = node, radius = d2;
|
||||
}
|
||||
return closest;
|
||||
},
|
||||
on: function(name, _) {
|
||||
return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/manyBody.js
|
||||
function manyBody_default() {
|
||||
var nodes, node, random, alpha, strength = constant_default(-30), strengths, distanceMin2 = 1, distanceMax2 = Infinity, theta2 = 0.81;
|
||||
function force(_) {
|
||||
var i, n = nodes.length, tree = quadtree(nodes, x2, y2).visitAfter(accumulate);
|
||||
for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);
|
||||
}
|
||||
function initialize() {
|
||||
if (!nodes) return;
|
||||
var i, n = nodes.length, node2;
|
||||
strengths = new Array(n);
|
||||
for (i = 0; i < n; ++i) node2 = nodes[i], strengths[node2.index] = +strength(node2, i, nodes);
|
||||
}
|
||||
function accumulate(quad) {
|
||||
var strength2 = 0, q, c2, weight = 0, x3, y3, i;
|
||||
if (quad.length) {
|
||||
for (x3 = y3 = i = 0; i < 4; ++i) {
|
||||
if ((q = quad[i]) && (c2 = Math.abs(q.value))) {
|
||||
strength2 += q.value, weight += c2, x3 += c2 * q.x, y3 += c2 * q.y;
|
||||
}
|
||||
}
|
||||
quad.x = x3 / weight;
|
||||
quad.y = y3 / weight;
|
||||
} else {
|
||||
q = quad;
|
||||
q.x = q.data.x;
|
||||
q.y = q.data.y;
|
||||
do
|
||||
strength2 += strengths[q.data.index];
|
||||
while (q = q.next);
|
||||
}
|
||||
quad.value = strength2;
|
||||
}
|
||||
function apply(quad, x1, _, x22) {
|
||||
if (!quad.value) return true;
|
||||
var x3 = quad.x - node.x, y3 = quad.y - node.y, w = x22 - x1, l = x3 * x3 + y3 * y3;
|
||||
if (w * w / theta2 < l) {
|
||||
if (l < distanceMax2) {
|
||||
if (x3 === 0) x3 = jiggle_default(random), l += x3 * x3;
|
||||
if (y3 === 0) y3 = jiggle_default(random), l += y3 * y3;
|
||||
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
|
||||
node.vx += x3 * quad.value * alpha / l;
|
||||
node.vy += y3 * quad.value * alpha / l;
|
||||
}
|
||||
return true;
|
||||
} else if (quad.length || l >= distanceMax2) return;
|
||||
if (quad.data !== node || quad.next) {
|
||||
if (x3 === 0) x3 = jiggle_default(random), l += x3 * x3;
|
||||
if (y3 === 0) y3 = jiggle_default(random), l += y3 * y3;
|
||||
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
|
||||
}
|
||||
do
|
||||
if (quad.data !== node) {
|
||||
w = strengths[quad.data.index] * alpha / l;
|
||||
node.vx += x3 * w;
|
||||
node.vy += y3 * w;
|
||||
}
|
||||
while (quad = quad.next);
|
||||
}
|
||||
force.initialize = function(_nodes, _random) {
|
||||
nodes = _nodes;
|
||||
random = _random;
|
||||
initialize();
|
||||
};
|
||||
force.strength = function(_) {
|
||||
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : strength;
|
||||
};
|
||||
force.distanceMin = function(_) {
|
||||
return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);
|
||||
};
|
||||
force.distanceMax = function(_) {
|
||||
return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);
|
||||
};
|
||||
force.theta = function(_) {
|
||||
return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);
|
||||
};
|
||||
return force;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/radial.js
|
||||
function radial_default(radius, x3, y3) {
|
||||
var nodes, strength = constant_default(0.1), strengths, radiuses;
|
||||
if (typeof radius !== "function") radius = constant_default(+radius);
|
||||
if (x3 == null) x3 = 0;
|
||||
if (y3 == null) y3 = 0;
|
||||
function force(alpha) {
|
||||
for (var i = 0, n = nodes.length; i < n; ++i) {
|
||||
var node = nodes[i], dx = node.x - x3 || 1e-6, dy = node.y - y3 || 1e-6, r = Math.sqrt(dx * dx + dy * dy), k = (radiuses[i] - r) * strengths[i] * alpha / r;
|
||||
node.vx += dx * k;
|
||||
node.vy += dy * k;
|
||||
}
|
||||
}
|
||||
function initialize() {
|
||||
if (!nodes) return;
|
||||
var i, n = nodes.length;
|
||||
strengths = new Array(n);
|
||||
radiuses = new Array(n);
|
||||
for (i = 0; i < n; ++i) {
|
||||
radiuses[i] = +radius(nodes[i], i, nodes);
|
||||
strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes);
|
||||
}
|
||||
}
|
||||
force.initialize = function(_) {
|
||||
nodes = _, initialize();
|
||||
};
|
||||
force.strength = function(_) {
|
||||
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : strength;
|
||||
};
|
||||
force.radius = function(_) {
|
||||
return arguments.length ? (radius = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : radius;
|
||||
};
|
||||
force.x = function(_) {
|
||||
return arguments.length ? (x3 = +_, force) : x3;
|
||||
};
|
||||
force.y = function(_) {
|
||||
return arguments.length ? (y3 = +_, force) : y3;
|
||||
};
|
||||
return force;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/x.js
|
||||
function x_default2(x3) {
|
||||
var strength = constant_default(0.1), nodes, strengths, xz;
|
||||
if (typeof x3 !== "function") x3 = constant_default(x3 == null ? 0 : +x3);
|
||||
function force(alpha) {
|
||||
for (var i = 0, n = nodes.length, node; i < n; ++i) {
|
||||
node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;
|
||||
}
|
||||
}
|
||||
function initialize() {
|
||||
if (!nodes) return;
|
||||
var i, n = nodes.length;
|
||||
strengths = new Array(n);
|
||||
xz = new Array(n);
|
||||
for (i = 0; i < n; ++i) {
|
||||
strengths[i] = isNaN(xz[i] = +x3(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
|
||||
}
|
||||
}
|
||||
force.initialize = function(_) {
|
||||
nodes = _;
|
||||
initialize();
|
||||
};
|
||||
force.strength = function(_) {
|
||||
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : strength;
|
||||
};
|
||||
force.x = function(_) {
|
||||
return arguments.length ? (x3 = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : x3;
|
||||
};
|
||||
return force;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/d3-force@3.0.0/node_modules/d3-force/src/y.js
|
||||
function y_default2(y3) {
|
||||
var strength = constant_default(0.1), nodes, strengths, yz;
|
||||
if (typeof y3 !== "function") y3 = constant_default(y3 == null ? 0 : +y3);
|
||||
function force(alpha) {
|
||||
for (var i = 0, n = nodes.length, node; i < n; ++i) {
|
||||
node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;
|
||||
}
|
||||
}
|
||||
function initialize() {
|
||||
if (!nodes) return;
|
||||
var i, n = nodes.length;
|
||||
strengths = new Array(n);
|
||||
yz = new Array(n);
|
||||
for (i = 0; i < n; ++i) {
|
||||
strengths[i] = isNaN(yz[i] = +y3(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
|
||||
}
|
||||
}
|
||||
force.initialize = function(_) {
|
||||
nodes = _;
|
||||
initialize();
|
||||
};
|
||||
force.strength = function(_) {
|
||||
return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : strength;
|
||||
};
|
||||
force.y = function(_) {
|
||||
return arguments.length ? (y3 = typeof _ === "function" ? _ : constant_default(+_), initialize(), force) : y3;
|
||||
};
|
||||
return force;
|
||||
}
|
||||
export {
|
||||
center_default as forceCenter,
|
||||
collide_default as forceCollide,
|
||||
link_default as forceLink,
|
||||
manyBody_default as forceManyBody,
|
||||
radial_default as forceRadial,
|
||||
simulation_default as forceSimulation,
|
||||
x_default2 as forceX,
|
||||
y_default2 as forceY
|
||||
};
|
||||
//# sourceMappingURL=d3-force.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/d3-force.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/d3-force.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
canvas-demo/node_modules/.vite/deps/debug.js
generated
vendored
Normal file
5
canvas-demo/node_modules/.vite/deps/debug.js
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import {
|
||||
require_browser
|
||||
} from "./chunk-5QTNICOS.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export default require_browser();
|
||||
7
canvas-demo/node_modules/.vite/deps/debug.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/debug.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
4624
canvas-demo/node_modules/.vite/deps/graphology.js
generated
vendored
Normal file
4624
canvas-demo/node_modules/.vite/deps/graphology.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/graphology.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/graphology.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
24
canvas-demo/node_modules/.vite/deps/jotai.js
generated
vendored
Normal file
24
canvas-demo/node_modules/.vite/deps/jotai.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import {
|
||||
INTERNAL_overrideCreateStore,
|
||||
Provider,
|
||||
atom,
|
||||
createStore,
|
||||
getDefaultStore,
|
||||
useAtom,
|
||||
useAtomValue,
|
||||
useSetAtom,
|
||||
useStore
|
||||
} from "./chunk-HZEBPUXZ.js";
|
||||
import "./chunk-T3SJLYUH.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export {
|
||||
INTERNAL_overrideCreateStore,
|
||||
Provider,
|
||||
atom,
|
||||
createStore,
|
||||
getDefaultStore,
|
||||
useAtom,
|
||||
useAtomValue,
|
||||
useSetAtom,
|
||||
useStore
|
||||
};
|
||||
7
canvas-demo/node_modules/.vite/deps/jotai.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/jotai.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
835
canvas-demo/node_modules/.vite/deps/jotai_utils.js
generated
vendored
Normal file
835
canvas-demo/node_modules/.vite/deps/jotai_utils.js
generated
vendored
Normal file
|
|
@ -0,0 +1,835 @@
|
|||
import {
|
||||
atom,
|
||||
useAtom,
|
||||
useSetAtom,
|
||||
useStore
|
||||
} from "./chunk-HZEBPUXZ.js";
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-T3SJLYUH.js";
|
||||
import {
|
||||
__toESM
|
||||
} from "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/jotai@2.16.0_@babel+core@7.28.5_@babel+template@7.27.2_@types+react@19.2.7_react@19.2.3/node_modules/jotai/esm/vanilla/utils.mjs
|
||||
var RESET = Symbol(
|
||||
(import.meta.env ? import.meta.env.MODE : void 0) !== "production" ? "RESET" : ""
|
||||
);
|
||||
function atomWithReset(initialValue) {
|
||||
const anAtom = atom(
|
||||
initialValue,
|
||||
(get, set, update) => {
|
||||
const nextValue = typeof update === "function" ? update(get(anAtom)) : update;
|
||||
set(anAtom, nextValue === RESET ? initialValue : nextValue);
|
||||
}
|
||||
);
|
||||
return anAtom;
|
||||
}
|
||||
function atomWithReducer(initialValue, reducer) {
|
||||
return atom(initialValue, function(get, set, action) {
|
||||
set(this, reducer(get(this), action));
|
||||
});
|
||||
}
|
||||
var didWarnDeprecation = false;
|
||||
function atomFamily(initializeAtom, areEqual) {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && !didWarnDeprecation) {
|
||||
console.warn(
|
||||
"[DEPRECATED] atomFamily is deprecated and will be removed in v3. Please use the `jotai-family` package instead: https://github.com/jotaijs/jotai-family"
|
||||
);
|
||||
didWarnDeprecation = true;
|
||||
}
|
||||
let shouldRemove = null;
|
||||
const atoms = /* @__PURE__ */ new Map();
|
||||
const listeners = /* @__PURE__ */ new Set();
|
||||
const createAtom = (param) => {
|
||||
let item;
|
||||
if (areEqual === void 0) {
|
||||
item = atoms.get(param);
|
||||
} else {
|
||||
for (const [key, value] of atoms) {
|
||||
if (areEqual(key, param)) {
|
||||
item = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item !== void 0) {
|
||||
if (shouldRemove == null ? void 0 : shouldRemove(item[1], param)) {
|
||||
createAtom.remove(param);
|
||||
} else {
|
||||
return item[0];
|
||||
}
|
||||
}
|
||||
const newAtom = initializeAtom(param);
|
||||
atoms.set(param, [newAtom, Date.now()]);
|
||||
notifyListeners("CREATE", param, newAtom);
|
||||
return newAtom;
|
||||
};
|
||||
const notifyListeners = (type, param, atom2) => {
|
||||
for (const listener of listeners) {
|
||||
listener({ type, param, atom: atom2 });
|
||||
}
|
||||
};
|
||||
createAtom.unstable_listen = (callback) => {
|
||||
listeners.add(callback);
|
||||
return () => {
|
||||
listeners.delete(callback);
|
||||
};
|
||||
};
|
||||
createAtom.getParams = () => atoms.keys();
|
||||
createAtom.remove = (param) => {
|
||||
if (areEqual === void 0) {
|
||||
if (!atoms.has(param)) return;
|
||||
const [atom2] = atoms.get(param);
|
||||
atoms.delete(param);
|
||||
notifyListeners("REMOVE", param, atom2);
|
||||
} else {
|
||||
for (const [key, [atom2]] of atoms) {
|
||||
if (areEqual(key, param)) {
|
||||
atoms.delete(key);
|
||||
notifyListeners("REMOVE", key, atom2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
createAtom.setShouldRemove = (fn) => {
|
||||
shouldRemove = fn;
|
||||
if (!shouldRemove) return;
|
||||
for (const [key, [atom2, createdAt]] of atoms) {
|
||||
if (shouldRemove(createdAt, key)) {
|
||||
atoms.delete(key);
|
||||
notifyListeners("REMOVE", key, atom2);
|
||||
}
|
||||
}
|
||||
};
|
||||
return createAtom;
|
||||
}
|
||||
var getCached$2 = (c, m, k) => (m.has(k) ? m : m.set(k, c())).get(k);
|
||||
var cache1$3 = /* @__PURE__ */ new WeakMap();
|
||||
var memo3 = (create, dep1, dep2, dep3) => {
|
||||
const cache2 = getCached$2(() => /* @__PURE__ */ new WeakMap(), cache1$3, dep1);
|
||||
const cache3 = getCached$2(() => /* @__PURE__ */ new WeakMap(), cache2, dep2);
|
||||
return getCached$2(create, cache3, dep3);
|
||||
};
|
||||
function selectAtom(anAtom, selector, equalityFn = Object.is) {
|
||||
return memo3(
|
||||
() => {
|
||||
const EMPTY = Symbol();
|
||||
const selectValue = ([value, prevSlice]) => {
|
||||
if (prevSlice === EMPTY) {
|
||||
return selector(value);
|
||||
}
|
||||
const slice = selector(value, prevSlice);
|
||||
return equalityFn(prevSlice, slice) ? prevSlice : slice;
|
||||
};
|
||||
const derivedAtom = atom((get) => {
|
||||
const prev = get(derivedAtom);
|
||||
const value = get(anAtom);
|
||||
return selectValue([value, prev]);
|
||||
});
|
||||
derivedAtom.init = EMPTY;
|
||||
return derivedAtom;
|
||||
},
|
||||
anAtom,
|
||||
selector,
|
||||
equalityFn
|
||||
);
|
||||
}
|
||||
var frozenAtoms = /* @__PURE__ */ new WeakSet();
|
||||
var deepFreeze = (value) => {
|
||||
if (typeof value !== "object" || value === null) {
|
||||
return value;
|
||||
}
|
||||
Object.freeze(value);
|
||||
const propNames = Object.getOwnPropertyNames(value);
|
||||
for (const name of propNames) {
|
||||
deepFreeze(value[name]);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
function freezeAtom(anAtom) {
|
||||
if (frozenAtoms.has(anAtom)) {
|
||||
return anAtom;
|
||||
}
|
||||
frozenAtoms.add(anAtom);
|
||||
const origRead = anAtom.read;
|
||||
anAtom.read = function(get, options) {
|
||||
return deepFreeze(origRead.call(this, get, options));
|
||||
};
|
||||
if ("write" in anAtom) {
|
||||
const origWrite = anAtom.write;
|
||||
anAtom.write = function(get, set, ...args) {
|
||||
return origWrite.call(
|
||||
this,
|
||||
get,
|
||||
(...setArgs) => {
|
||||
if (setArgs[0] === anAtom) {
|
||||
setArgs[1] = deepFreeze(setArgs[1]);
|
||||
}
|
||||
return set(...setArgs);
|
||||
},
|
||||
...args
|
||||
);
|
||||
};
|
||||
}
|
||||
return anAtom;
|
||||
}
|
||||
function freezeAtomCreator(createAtom) {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
console.warn(
|
||||
"[DEPRECATED] freezeAtomCreator is deprecated, define it on users end"
|
||||
);
|
||||
}
|
||||
return ((...args) => freezeAtom(createAtom(...args)));
|
||||
}
|
||||
var getCached$1 = (c, m, k) => (m.has(k) ? m : m.set(k, c())).get(k);
|
||||
var cache1$2 = /* @__PURE__ */ new WeakMap();
|
||||
var memo2$1 = (create, dep1, dep2) => {
|
||||
const cache2 = getCached$1(() => /* @__PURE__ */ new WeakMap(), cache1$2, dep1);
|
||||
return getCached$1(create, cache2, dep2);
|
||||
};
|
||||
var cacheKeyForEmptyKeyExtractor = {};
|
||||
var isWritable = (atom2) => !!atom2.write;
|
||||
var isFunction = (x) => typeof x === "function";
|
||||
function splitAtom(arrAtom, keyExtractor) {
|
||||
return memo2$1(
|
||||
() => {
|
||||
const mappingCache = /* @__PURE__ */ new WeakMap();
|
||||
const getMapping = (arr, prev) => {
|
||||
let mapping = mappingCache.get(arr);
|
||||
if (mapping) {
|
||||
return mapping;
|
||||
}
|
||||
const prevMapping = prev && mappingCache.get(prev);
|
||||
const atomList = [];
|
||||
const keyList = [];
|
||||
arr.forEach((item, index) => {
|
||||
const key = keyExtractor ? keyExtractor(item) : index;
|
||||
keyList[index] = key;
|
||||
const cachedAtom = prevMapping && prevMapping.atomList[prevMapping.keyList.indexOf(key)];
|
||||
if (cachedAtom) {
|
||||
atomList[index] = cachedAtom;
|
||||
return;
|
||||
}
|
||||
const read = (get) => {
|
||||
const prev2 = get(mappingAtom);
|
||||
const currArr = get(arrAtom);
|
||||
const mapping2 = getMapping(currArr, prev2 == null ? void 0 : prev2.arr);
|
||||
const index2 = mapping2.keyList.indexOf(key);
|
||||
if (index2 < 0 || index2 >= currArr.length) {
|
||||
const prevItem = arr[getMapping(arr).keyList.indexOf(key)];
|
||||
if (prevItem) {
|
||||
return prevItem;
|
||||
}
|
||||
throw new Error("splitAtom: index out of bounds for read");
|
||||
}
|
||||
return currArr[index2];
|
||||
};
|
||||
const write = (get, set, update) => {
|
||||
const prev2 = get(mappingAtom);
|
||||
const arr2 = get(arrAtom);
|
||||
const mapping2 = getMapping(arr2, prev2 == null ? void 0 : prev2.arr);
|
||||
const index2 = mapping2.keyList.indexOf(key);
|
||||
if (index2 < 0 || index2 >= arr2.length) {
|
||||
throw new Error("splitAtom: index out of bounds for write");
|
||||
}
|
||||
const nextItem = isFunction(update) ? update(arr2[index2]) : update;
|
||||
if (!Object.is(arr2[index2], nextItem)) {
|
||||
set(arrAtom, [
|
||||
...arr2.slice(0, index2),
|
||||
nextItem,
|
||||
...arr2.slice(index2 + 1)
|
||||
]);
|
||||
}
|
||||
};
|
||||
atomList[index] = isWritable(arrAtom) ? atom(read, write) : atom(read);
|
||||
});
|
||||
if (prevMapping && prevMapping.keyList.length === keyList.length && prevMapping.keyList.every((x, i) => x === keyList[i])) {
|
||||
mapping = prevMapping;
|
||||
} else {
|
||||
mapping = { arr, atomList, keyList };
|
||||
}
|
||||
mappingCache.set(arr, mapping);
|
||||
return mapping;
|
||||
};
|
||||
const mappingAtom = atom((get) => {
|
||||
const prev = get(mappingAtom);
|
||||
const arr = get(arrAtom);
|
||||
const mapping = getMapping(arr, prev == null ? void 0 : prev.arr);
|
||||
return mapping;
|
||||
});
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
mappingAtom.debugPrivate = true;
|
||||
}
|
||||
mappingAtom.init = void 0;
|
||||
const splittedAtom = isWritable(arrAtom) ? atom(
|
||||
(get) => get(mappingAtom).atomList,
|
||||
(get, set, action) => {
|
||||
switch (action.type) {
|
||||
case "remove": {
|
||||
const index = get(splittedAtom).indexOf(action.atom);
|
||||
if (index >= 0) {
|
||||
const arr = get(arrAtom);
|
||||
set(arrAtom, [
|
||||
...arr.slice(0, index),
|
||||
...arr.slice(index + 1)
|
||||
]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "insert": {
|
||||
const index = action.before ? get(splittedAtom).indexOf(action.before) : get(splittedAtom).length;
|
||||
if (index >= 0) {
|
||||
const arr = get(arrAtom);
|
||||
set(arrAtom, [
|
||||
...arr.slice(0, index),
|
||||
action.value,
|
||||
...arr.slice(index)
|
||||
]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "move": {
|
||||
const index1 = get(splittedAtom).indexOf(action.atom);
|
||||
const index2 = action.before ? get(splittedAtom).indexOf(action.before) : get(splittedAtom).length;
|
||||
if (index1 >= 0 && index2 >= 0) {
|
||||
const arr = get(arrAtom);
|
||||
if (index1 < index2) {
|
||||
set(arrAtom, [
|
||||
...arr.slice(0, index1),
|
||||
...arr.slice(index1 + 1, index2),
|
||||
arr[index1],
|
||||
...arr.slice(index2)
|
||||
]);
|
||||
} else {
|
||||
set(arrAtom, [
|
||||
...arr.slice(0, index2),
|
||||
arr[index1],
|
||||
...arr.slice(index2, index1),
|
||||
...arr.slice(index1 + 1)
|
||||
]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
) : atom((get) => get(mappingAtom).atomList);
|
||||
return splittedAtom;
|
||||
},
|
||||
arrAtom,
|
||||
keyExtractor || cacheKeyForEmptyKeyExtractor
|
||||
);
|
||||
}
|
||||
function atomWithDefault(getDefault) {
|
||||
const EMPTY = Symbol();
|
||||
const overwrittenAtom = atom(EMPTY);
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
overwrittenAtom.debugPrivate = true;
|
||||
}
|
||||
const anAtom = atom(
|
||||
(get, options) => {
|
||||
const overwritten = get(overwrittenAtom);
|
||||
if (overwritten !== EMPTY) {
|
||||
return overwritten;
|
||||
}
|
||||
return getDefault(get, options);
|
||||
},
|
||||
(get, set, update) => {
|
||||
const newValue = typeof update === "function" ? update(get(anAtom)) : update;
|
||||
set(overwrittenAtom, newValue === RESET ? EMPTY : newValue);
|
||||
}
|
||||
);
|
||||
return anAtom;
|
||||
}
|
||||
var isPromiseLike$3 = (x) => typeof (x == null ? void 0 : x.then) === "function";
|
||||
function withStorageValidator(validator) {
|
||||
return (unknownStorage) => {
|
||||
const storage = {
|
||||
...unknownStorage,
|
||||
getItem: (key, initialValue) => {
|
||||
const validate = (value2) => {
|
||||
if (!validator(value2)) {
|
||||
return initialValue;
|
||||
}
|
||||
return value2;
|
||||
};
|
||||
const value = unknownStorage.getItem(key, initialValue);
|
||||
if (isPromiseLike$3(value)) {
|
||||
return value.then(validate);
|
||||
}
|
||||
return validate(value);
|
||||
}
|
||||
};
|
||||
return storage;
|
||||
};
|
||||
}
|
||||
function createJSONStorage(getStringStorage = () => {
|
||||
try {
|
||||
return window.localStorage;
|
||||
} catch (e) {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
if (typeof window !== "undefined") {
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
}, options) {
|
||||
var _a;
|
||||
let lastStr;
|
||||
let lastValue;
|
||||
const storage = {
|
||||
getItem: (key, initialValue) => {
|
||||
var _a2, _b;
|
||||
const parse = (str2) => {
|
||||
str2 = str2 || "";
|
||||
if (lastStr !== str2) {
|
||||
try {
|
||||
lastValue = JSON.parse(str2, options == null ? void 0 : options.reviver);
|
||||
} catch (e) {
|
||||
return initialValue;
|
||||
}
|
||||
lastStr = str2;
|
||||
}
|
||||
return lastValue;
|
||||
};
|
||||
const str = (_b = (_a2 = getStringStorage()) == null ? void 0 : _a2.getItem(key)) != null ? _b : null;
|
||||
if (isPromiseLike$3(str)) {
|
||||
return str.then(parse);
|
||||
}
|
||||
return parse(str);
|
||||
},
|
||||
setItem: (key, newValue) => {
|
||||
var _a2;
|
||||
return (_a2 = getStringStorage()) == null ? void 0 : _a2.setItem(
|
||||
key,
|
||||
JSON.stringify(newValue, options == null ? void 0 : options.replacer)
|
||||
);
|
||||
},
|
||||
removeItem: (key) => {
|
||||
var _a2;
|
||||
return (_a2 = getStringStorage()) == null ? void 0 : _a2.removeItem(key);
|
||||
}
|
||||
};
|
||||
const createHandleSubscribe = (subscriber2) => (key, callback, initialValue) => subscriber2(key, (v) => {
|
||||
let newValue;
|
||||
try {
|
||||
newValue = JSON.parse(v || "");
|
||||
} catch (e) {
|
||||
newValue = initialValue;
|
||||
}
|
||||
callback(newValue);
|
||||
});
|
||||
let subscriber;
|
||||
try {
|
||||
subscriber = (_a = getStringStorage()) == null ? void 0 : _a.subscribe;
|
||||
} catch (e) {
|
||||
}
|
||||
if (!subscriber && typeof window !== "undefined" && typeof window.addEventListener === "function" && window.Storage) {
|
||||
subscriber = (key, callback) => {
|
||||
if (!(getStringStorage() instanceof window.Storage)) {
|
||||
return () => {
|
||||
};
|
||||
}
|
||||
const storageEventCallback = (e) => {
|
||||
if (e.storageArea === getStringStorage() && e.key === key) {
|
||||
callback(e.newValue);
|
||||
}
|
||||
};
|
||||
window.addEventListener("storage", storageEventCallback);
|
||||
return () => {
|
||||
window.removeEventListener("storage", storageEventCallback);
|
||||
};
|
||||
};
|
||||
}
|
||||
if (subscriber) {
|
||||
storage.subscribe = createHandleSubscribe(subscriber);
|
||||
}
|
||||
return storage;
|
||||
}
|
||||
var defaultStorage = createJSONStorage();
|
||||
function atomWithStorage(key, initialValue, storage = defaultStorage, options) {
|
||||
const getOnInit = options == null ? void 0 : options.getOnInit;
|
||||
const baseAtom = atom(
|
||||
getOnInit ? storage.getItem(key, initialValue) : initialValue
|
||||
);
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
baseAtom.debugPrivate = true;
|
||||
}
|
||||
baseAtom.onMount = (setAtom) => {
|
||||
setAtom(storage.getItem(key, initialValue));
|
||||
let unsub;
|
||||
if (storage.subscribe) {
|
||||
unsub = storage.subscribe(key, setAtom, initialValue);
|
||||
}
|
||||
return unsub;
|
||||
};
|
||||
const anAtom = atom(
|
||||
(get) => get(baseAtom),
|
||||
(get, set, update) => {
|
||||
const nextValue = typeof update === "function" ? update(get(baseAtom)) : update;
|
||||
if (nextValue === RESET) {
|
||||
set(baseAtom, initialValue);
|
||||
return storage.removeItem(key);
|
||||
}
|
||||
if (isPromiseLike$3(nextValue)) {
|
||||
return nextValue.then((resolvedValue) => {
|
||||
set(baseAtom, resolvedValue);
|
||||
return storage.setItem(key, resolvedValue);
|
||||
});
|
||||
}
|
||||
set(baseAtom, nextValue);
|
||||
return storage.setItem(key, nextValue);
|
||||
}
|
||||
);
|
||||
return anAtom;
|
||||
}
|
||||
var isPromiseLike$2 = (x) => typeof (x == null ? void 0 : x.then) === "function";
|
||||
function atomWithObservable(getObservable, options) {
|
||||
const returnResultData = (result) => {
|
||||
if ("e" in result) {
|
||||
throw result.e;
|
||||
}
|
||||
return result.d;
|
||||
};
|
||||
const observableResultAtom = atom((get) => {
|
||||
var _a;
|
||||
let observable = getObservable(get);
|
||||
const itself = (_a = observable[Symbol.observable]) == null ? void 0 : _a.call(observable);
|
||||
if (itself) {
|
||||
observable = itself;
|
||||
}
|
||||
let resolve;
|
||||
const makePending = () => new Promise((r) => {
|
||||
resolve = r;
|
||||
});
|
||||
const initialResult = options && "initialValue" in options ? {
|
||||
d: typeof options.initialValue === "function" ? options.initialValue() : options.initialValue
|
||||
} : makePending();
|
||||
let setResult;
|
||||
let lastResult;
|
||||
const listener = (result) => {
|
||||
lastResult = result;
|
||||
resolve == null ? void 0 : resolve(result);
|
||||
setResult == null ? void 0 : setResult(result);
|
||||
};
|
||||
let subscription;
|
||||
let timer;
|
||||
const isNotMounted = () => !setResult;
|
||||
const unsubscribe = () => {
|
||||
if (subscription) {
|
||||
subscription.unsubscribe();
|
||||
subscription = void 0;
|
||||
}
|
||||
};
|
||||
const start = () => {
|
||||
if (subscription) {
|
||||
clearTimeout(timer);
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
subscription = observable.subscribe({
|
||||
next: (d) => listener({ d }),
|
||||
error: (e) => listener({ e }),
|
||||
complete: () => {
|
||||
}
|
||||
});
|
||||
if (isNotMounted() && (options == null ? void 0 : options.unstable_timeout)) {
|
||||
timer = setTimeout(unsubscribe, options.unstable_timeout);
|
||||
}
|
||||
};
|
||||
start();
|
||||
const resultAtom = atom(lastResult || initialResult);
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
resultAtom.debugPrivate = true;
|
||||
}
|
||||
resultAtom.onMount = (update) => {
|
||||
setResult = update;
|
||||
if (lastResult) {
|
||||
update(lastResult);
|
||||
}
|
||||
if (subscription) {
|
||||
clearTimeout(timer);
|
||||
} else {
|
||||
start();
|
||||
}
|
||||
return () => {
|
||||
setResult = void 0;
|
||||
if (options == null ? void 0 : options.unstable_timeout) {
|
||||
timer = setTimeout(unsubscribe, options.unstable_timeout);
|
||||
} else {
|
||||
unsubscribe();
|
||||
}
|
||||
};
|
||||
};
|
||||
return [resultAtom, observable, makePending, start, isNotMounted];
|
||||
});
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
observableResultAtom.debugPrivate = true;
|
||||
}
|
||||
const observableAtom = atom(
|
||||
(get) => {
|
||||
const [resultAtom] = get(observableResultAtom);
|
||||
const result = get(resultAtom);
|
||||
if (isPromiseLike$2(result)) {
|
||||
return result.then(returnResultData);
|
||||
}
|
||||
return returnResultData(result);
|
||||
},
|
||||
(get, set, data) => {
|
||||
const [resultAtom, observable, makePending, start, isNotMounted] = get(observableResultAtom);
|
||||
if ("next" in observable) {
|
||||
if (isNotMounted()) {
|
||||
set(resultAtom, makePending());
|
||||
start();
|
||||
}
|
||||
observable.next(data);
|
||||
} else {
|
||||
throw new Error("observable is not subject");
|
||||
}
|
||||
}
|
||||
);
|
||||
return observableAtom;
|
||||
}
|
||||
var cache1$1 = /* @__PURE__ */ new WeakMap();
|
||||
var memo1 = (create, dep1) => (cache1$1.has(dep1) ? cache1$1 : cache1$1.set(dep1, create())).get(dep1);
|
||||
var isPromiseLike$1 = (p) => typeof (p == null ? void 0 : p.then) === "function";
|
||||
var LOADING = { state: "loading" };
|
||||
function loadable(anAtom) {
|
||||
return memo1(() => {
|
||||
const loadableCache = /* @__PURE__ */ new WeakMap();
|
||||
const refreshAtom = atom([() => {
|
||||
}, 0]);
|
||||
refreshAtom.INTERNAL_onInit = (store) => {
|
||||
store.set(refreshAtom, ([, c]) => [
|
||||
() => store.set(refreshAtom, ([f, c2]) => [f, c2 + 1]),
|
||||
c
|
||||
]);
|
||||
};
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
refreshAtom.debugPrivate = true;
|
||||
}
|
||||
const derivedAtom = atom((get) => {
|
||||
const [triggerRefresh] = get(refreshAtom);
|
||||
let value;
|
||||
try {
|
||||
value = get(anAtom);
|
||||
} catch (error) {
|
||||
return { state: "hasError", error };
|
||||
}
|
||||
if (!isPromiseLike$1(value)) {
|
||||
return { state: "hasData", data: value };
|
||||
}
|
||||
const promise = value;
|
||||
const cached1 = loadableCache.get(promise);
|
||||
if (cached1) {
|
||||
return cached1;
|
||||
}
|
||||
promise.then(
|
||||
(data) => {
|
||||
loadableCache.set(promise, { state: "hasData", data });
|
||||
triggerRefresh();
|
||||
},
|
||||
(error) => {
|
||||
loadableCache.set(promise, { state: "hasError", error });
|
||||
triggerRefresh();
|
||||
}
|
||||
);
|
||||
const cached2 = loadableCache.get(promise);
|
||||
if (cached2) {
|
||||
return cached2;
|
||||
}
|
||||
loadableCache.set(promise, LOADING);
|
||||
return LOADING;
|
||||
});
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
derivedAtom.debugPrivate = true;
|
||||
}
|
||||
return atom((get) => get(derivedAtom));
|
||||
}, anAtom);
|
||||
}
|
||||
var getCached = (c, m, k) => (m.has(k) ? m : m.set(k, c())).get(k);
|
||||
var cache1 = /* @__PURE__ */ new WeakMap();
|
||||
var memo2 = (create, dep1, dep2) => {
|
||||
const cache2 = getCached(() => /* @__PURE__ */ new WeakMap(), cache1, dep1);
|
||||
return getCached(create, cache2, dep2);
|
||||
};
|
||||
var isPromiseLike = (p) => typeof (p == null ? void 0 : p.then) === "function";
|
||||
var defaultFallback = () => void 0;
|
||||
function unwrap(anAtom, fallback = defaultFallback) {
|
||||
return memo2(
|
||||
() => {
|
||||
const promiseErrorCache = /* @__PURE__ */ new WeakMap();
|
||||
const promiseResultCache = /* @__PURE__ */ new WeakMap();
|
||||
const refreshAtom = atom([() => {
|
||||
}, 0]);
|
||||
refreshAtom.INTERNAL_onInit = (store) => {
|
||||
store.set(refreshAtom, ([, c]) => [
|
||||
() => store.set(refreshAtom, ([f, c2]) => [f, c2 + 1]),
|
||||
c
|
||||
]);
|
||||
};
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
refreshAtom.debugPrivate = true;
|
||||
}
|
||||
const promiseAndValueAtom = atom((get) => {
|
||||
const [triggerRefresh] = get(refreshAtom);
|
||||
let prev;
|
||||
try {
|
||||
prev = get(promiseAndValueAtom);
|
||||
} catch (e) {
|
||||
}
|
||||
const promise = get(anAtom);
|
||||
if (!isPromiseLike(promise)) {
|
||||
return { v: promise };
|
||||
}
|
||||
if (promise !== (prev == null ? void 0 : prev.p)) {
|
||||
promise.then(
|
||||
(v) => {
|
||||
promiseResultCache.set(promise, v);
|
||||
triggerRefresh();
|
||||
},
|
||||
(e) => {
|
||||
promiseErrorCache.set(promise, e);
|
||||
triggerRefresh();
|
||||
}
|
||||
);
|
||||
}
|
||||
if (promiseErrorCache.has(promise)) {
|
||||
throw promiseErrorCache.get(promise);
|
||||
}
|
||||
if (promiseResultCache.has(promise)) {
|
||||
return {
|
||||
p: promise,
|
||||
v: promiseResultCache.get(promise)
|
||||
};
|
||||
}
|
||||
if (prev && "v" in prev) {
|
||||
return { p: promise, f: fallback(prev.v), v: prev.v };
|
||||
}
|
||||
return { p: promise, f: fallback() };
|
||||
});
|
||||
promiseAndValueAtom.init = void 0;
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
promiseAndValueAtom.debugPrivate = true;
|
||||
}
|
||||
return atom(
|
||||
(get) => {
|
||||
const state = get(promiseAndValueAtom);
|
||||
if ("f" in state) {
|
||||
return state.f;
|
||||
}
|
||||
return state.v;
|
||||
},
|
||||
(_get, set, ...args) => set(anAtom, ...args)
|
||||
);
|
||||
},
|
||||
anAtom,
|
||||
fallback
|
||||
);
|
||||
}
|
||||
function atomWithRefresh(read, write) {
|
||||
const refreshAtom = atom(0);
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
refreshAtom.debugPrivate = true;
|
||||
}
|
||||
return atom(
|
||||
(get, options) => {
|
||||
get(refreshAtom);
|
||||
return read(get, options);
|
||||
},
|
||||
(get, set, ...args) => {
|
||||
if (args.length === 0) {
|
||||
set(refreshAtom, (c) => c + 1);
|
||||
} else if (write) {
|
||||
return write(get, set, ...args);
|
||||
} else if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
throw new Error("refresh must be called without arguments");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
function atomWithLazy(makeInitial) {
|
||||
const a = atom(void 0);
|
||||
delete a.init;
|
||||
Object.defineProperty(a, "init", {
|
||||
get() {
|
||||
return makeInitial();
|
||||
}
|
||||
});
|
||||
return a;
|
||||
}
|
||||
|
||||
// ../../node_modules/.pnpm/jotai@2.16.0_@babel+core@7.28.5_@babel+template@7.27.2_@types+react@19.2.7_react@19.2.3/node_modules/jotai/esm/react/utils.mjs
|
||||
var import_react = __toESM(require_react(), 1);
|
||||
function useResetAtom(anAtom, options) {
|
||||
const setAtom = useSetAtom(anAtom, options);
|
||||
const resetAtom = (0, import_react.useCallback)(() => setAtom(RESET), [setAtom]);
|
||||
return resetAtom;
|
||||
}
|
||||
function useReducerAtom(anAtom, reducer, options) {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
|
||||
console.warn(
|
||||
"[DEPRECATED] useReducerAtom is deprecated and will be removed in the future. Please create your own version using the recipe. https://github.com/pmndrs/jotai/pull/2467"
|
||||
);
|
||||
}
|
||||
const [state, setState] = useAtom(anAtom, options);
|
||||
const dispatch = (0, import_react.useCallback)(
|
||||
(action) => {
|
||||
setState((prev) => reducer(prev, action));
|
||||
},
|
||||
[setState, reducer]
|
||||
);
|
||||
return [state, dispatch];
|
||||
}
|
||||
function useAtomCallback(callback, options) {
|
||||
const anAtom = (0, import_react.useMemo)(
|
||||
() => atom(null, (get, set, ...args) => callback(get, set, ...args)),
|
||||
[callback]
|
||||
);
|
||||
return useSetAtom(anAtom, options);
|
||||
}
|
||||
var hydratedMap = /* @__PURE__ */ new WeakMap();
|
||||
function useHydrateAtoms(values, options) {
|
||||
const store = useStore(options);
|
||||
const hydratedSet = getHydratedSet(store);
|
||||
for (const [atom2, ...args] of values) {
|
||||
if (!hydratedSet.has(atom2) || (options == null ? void 0 : options.dangerouslyForceHydrate)) {
|
||||
hydratedSet.add(atom2);
|
||||
store.set(atom2, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
var getHydratedSet = (store) => {
|
||||
let hydratedSet = hydratedMap.get(store);
|
||||
if (!hydratedSet) {
|
||||
hydratedSet = /* @__PURE__ */ new WeakSet();
|
||||
hydratedMap.set(store, hydratedSet);
|
||||
}
|
||||
return hydratedSet;
|
||||
};
|
||||
export {
|
||||
RESET,
|
||||
atomFamily,
|
||||
atomWithDefault,
|
||||
atomWithLazy,
|
||||
atomWithObservable,
|
||||
atomWithReducer,
|
||||
atomWithRefresh,
|
||||
atomWithReset,
|
||||
atomWithStorage,
|
||||
createJSONStorage,
|
||||
freezeAtom,
|
||||
freezeAtomCreator,
|
||||
loadable,
|
||||
selectAtom,
|
||||
splitAtom,
|
||||
withStorageValidator as unstable_withStorageValidator,
|
||||
unwrap,
|
||||
useAtomCallback,
|
||||
useHydrateAtoms,
|
||||
useReducerAtom,
|
||||
useResetAtom
|
||||
};
|
||||
//# sourceMappingURL=jotai_utils.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/jotai_utils.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/jotai_utils.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
29680
canvas-demo/node_modules/.vite/deps/lucide-react.js
generated
vendored
Normal file
29680
canvas-demo/node_modules/.vite/deps/lucide-react.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
canvas-demo/node_modules/.vite/deps/lucide-react.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/lucide-react.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2615
canvas-demo/node_modules/.vite/deps/module-4GIHSJCO.js
generated
vendored
Normal file
2615
canvas-demo/node_modules/.vite/deps/module-4GIHSJCO.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
canvas-demo/node_modules/.vite/deps/module-4GIHSJCO.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/module-4GIHSJCO.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
16
canvas-demo/node_modules/.vite/deps/native-JYCSL3WK.js
generated
vendored
Normal file
16
canvas-demo/node_modules/.vite/deps/native-JYCSL3WK.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
canvas-demo/node_modules/.vite/deps/native-JYCSL3WK.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/native-JYCSL3WK.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
canvas-demo/node_modules/.vite/deps/package.json
generated
vendored
Normal file
3
canvas-demo/node_modules/.vite/deps/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
6
canvas-demo/node_modules/.vite/deps/react-dom.js
generated
vendored
Normal file
6
canvas-demo/node_modules/.vite/deps/react-dom.js
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import {
|
||||
require_react_dom
|
||||
} from "./chunk-LRUX6XQC.js";
|
||||
import "./chunk-T3SJLYUH.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export default require_react_dom();
|
||||
7
canvas-demo/node_modules/.vite/deps/react-dom.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/react-dom.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
7
canvas-demo/node_modules/.vite/deps/react-dom_client.js
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/react-dom_client.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import {
|
||||
require_client
|
||||
} from "./chunk-DZXNXIW7.js";
|
||||
import "./chunk-LRUX6XQC.js";
|
||||
import "./chunk-T3SJLYUH.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export default require_client();
|
||||
7
canvas-demo/node_modules/.vite/deps/react-dom_client.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/react-dom_client.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
5
canvas-demo/node_modules/.vite/deps/react.js
generated
vendored
Normal file
5
canvas-demo/node_modules/.vite/deps/react.js
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import {
|
||||
require_react
|
||||
} from "./chunk-T3SJLYUH.js";
|
||||
import "./chunk-4B2QHNJT.js";
|
||||
export default require_react();
|
||||
7
canvas-demo/node_modules/.vite/deps/react.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/react.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
278
canvas-demo/node_modules/.vite/deps/react_jsx-dev-runtime.js
generated
vendored
Normal file
278
canvas-demo/node_modules/.vite/deps/react_jsx-dev-runtime.js
generated
vendored
Normal file
|
|
@ -0,0 +1,278 @@
|
|||
import {
|
||||
require_react
|
||||
} from "./chunk-T3SJLYUH.js";
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-4B2QHNJT.js";
|
||||
|
||||
// ../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
||||
var require_react_jsx_dev_runtime_development = __commonJS({
|
||||
"../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-dev-runtime.development.js"(exports) {
|
||||
"use strict";
|
||||
(function() {
|
||||
function getComponentNameFromType(type) {
|
||||
if (null == type) return null;
|
||||
if ("function" === typeof type)
|
||||
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||
if ("string" === typeof type) return type;
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE:
|
||||
return "Fragment";
|
||||
case REACT_PROFILER_TYPE:
|
||||
return "Profiler";
|
||||
case REACT_STRICT_MODE_TYPE:
|
||||
return "StrictMode";
|
||||
case REACT_SUSPENSE_TYPE:
|
||||
return "Suspense";
|
||||
case REACT_SUSPENSE_LIST_TYPE:
|
||||
return "SuspenseList";
|
||||
case REACT_ACTIVITY_TYPE:
|
||||
return "Activity";
|
||||
}
|
||||
if ("object" === typeof type)
|
||||
switch ("number" === typeof type.tag && console.error(
|
||||
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
||||
), type.$$typeof) {
|
||||
case REACT_PORTAL_TYPE:
|
||||
return "Portal";
|
||||
case REACT_CONTEXT_TYPE:
|
||||
return type.displayName || "Context";
|
||||
case REACT_CONSUMER_TYPE:
|
||||
return (type._context.displayName || "Context") + ".Consumer";
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
var innerType = type.render;
|
||||
type = type.displayName;
|
||||
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||
return type;
|
||||
case REACT_MEMO_TYPE:
|
||||
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||
case REACT_LAZY_TYPE:
|
||||
innerType = type._payload;
|
||||
type = type._init;
|
||||
try {
|
||||
return getComponentNameFromType(type(innerType));
|
||||
} catch (x) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function checkKeyStringCoercion(value) {
|
||||
try {
|
||||
testStringCoercion(value);
|
||||
var JSCompiler_inline_result = false;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = true;
|
||||
}
|
||||
if (JSCompiler_inline_result) {
|
||||
JSCompiler_inline_result = console;
|
||||
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||
JSCompiler_temp_const.call(
|
||||
JSCompiler_inline_result,
|
||||
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||
JSCompiler_inline_result$jscomp$0
|
||||
);
|
||||
return testStringCoercion(value);
|
||||
}
|
||||
}
|
||||
function getTaskName(type) {
|
||||
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
||||
return "<...>";
|
||||
try {
|
||||
var name = getComponentNameFromType(type);
|
||||
return name ? "<" + name + ">" : "<...>";
|
||||
} catch (x) {
|
||||
return "<...>";
|
||||
}
|
||||
}
|
||||
function getOwner() {
|
||||
var dispatcher = ReactSharedInternals.A;
|
||||
return null === dispatcher ? null : dispatcher.getOwner();
|
||||
}
|
||||
function UnknownOwner() {
|
||||
return Error("react-stack-top-frame");
|
||||
}
|
||||
function hasValidKey(config) {
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||
if (getter && getter.isReactWarning) return false;
|
||||
}
|
||||
return void 0 !== config.key;
|
||||
}
|
||||
function defineKeyPropWarningGetter(props, displayName) {
|
||||
function warnAboutAccessingKey() {
|
||||
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
||||
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
||||
displayName
|
||||
));
|
||||
}
|
||||
warnAboutAccessingKey.isReactWarning = true;
|
||||
Object.defineProperty(props, "key", {
|
||||
get: warnAboutAccessingKey,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function elementRefGetterWithDeprecationWarning() {
|
||||
var componentName = getComponentNameFromType(this.type);
|
||||
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
||||
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
||||
));
|
||||
componentName = this.props.ref;
|
||||
return void 0 !== componentName ? componentName : null;
|
||||
}
|
||||
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
||||
var refProp = props.ref;
|
||||
type = {
|
||||
$$typeof: REACT_ELEMENT_TYPE,
|
||||
type,
|
||||
key,
|
||||
props,
|
||||
_owner: owner
|
||||
};
|
||||
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
||||
enumerable: false,
|
||||
get: elementRefGetterWithDeprecationWarning
|
||||
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
||||
type._store = {};
|
||||
Object.defineProperty(type._store, "validated", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: 0
|
||||
});
|
||||
Object.defineProperty(type, "_debugInfo", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: null
|
||||
});
|
||||
Object.defineProperty(type, "_debugStack", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugStack
|
||||
});
|
||||
Object.defineProperty(type, "_debugTask", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugTask
|
||||
});
|
||||
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||
return type;
|
||||
}
|
||||
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
||||
var children = config.children;
|
||||
if (void 0 !== children)
|
||||
if (isStaticChildren)
|
||||
if (isArrayImpl(children)) {
|
||||
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
||||
validateChildKeys(children[isStaticChildren]);
|
||||
Object.freeze && Object.freeze(children);
|
||||
} else
|
||||
console.error(
|
||||
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
||||
);
|
||||
else validateChildKeys(children);
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
children = getComponentNameFromType(type);
|
||||
var keys = Object.keys(config).filter(function(k) {
|
||||
return "key" !== k;
|
||||
});
|
||||
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
||||
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
||||
isStaticChildren,
|
||||
children,
|
||||
keys,
|
||||
children
|
||||
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
||||
}
|
||||
children = null;
|
||||
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||
if ("key" in config) {
|
||||
maybeKey = {};
|
||||
for (var propName in config)
|
||||
"key" !== propName && (maybeKey[propName] = config[propName]);
|
||||
} else maybeKey = config;
|
||||
children && defineKeyPropWarningGetter(
|
||||
maybeKey,
|
||||
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
||||
);
|
||||
return ReactElement(
|
||||
type,
|
||||
children,
|
||||
maybeKey,
|
||||
getOwner(),
|
||||
debugStack,
|
||||
debugTask
|
||||
);
|
||||
}
|
||||
function validateChildKeys(node) {
|
||||
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
||||
}
|
||||
function isValidElement(object) {
|
||||
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||
}
|
||||
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||
return null;
|
||||
};
|
||||
React = {
|
||||
react_stack_bottom_frame: function(callStackForError) {
|
||||
return callStackForError();
|
||||
}
|
||||
};
|
||||
var specialPropKeyWarningShown;
|
||||
var didWarnAboutElementRef = {};
|
||||
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
||||
React,
|
||||
UnknownOwner
|
||||
)();
|
||||
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||
var didWarnAboutKeySpread = {};
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.jsxDEV = function(type, config, maybeKey, isStaticChildren) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
return jsxDEVImpl(
|
||||
type,
|
||||
config,
|
||||
maybeKey,
|
||||
isStaticChildren,
|
||||
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||
);
|
||||
};
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// ../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-dev-runtime.js
|
||||
var require_jsx_dev_runtime = __commonJS({
|
||||
"../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-dev-runtime.js"(exports, module) {
|
||||
if (false) {
|
||||
module.exports = null;
|
||||
} else {
|
||||
module.exports = require_react_jsx_dev_runtime_development();
|
||||
}
|
||||
}
|
||||
});
|
||||
export default require_jsx_dev_runtime();
|
||||
/*! Bundled license information:
|
||||
|
||||
react/cjs/react-jsx-dev-runtime.development.js:
|
||||
(**
|
||||
* @license React
|
||||
* react-jsx-dev-runtime.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
*/
|
||||
//# sourceMappingURL=react_jsx-dev-runtime.js.map
|
||||
7
canvas-demo/node_modules/.vite/deps/react_jsx-dev-runtime.js.map
generated
vendored
Normal file
7
canvas-demo/node_modules/.vite/deps/react_jsx-dev-runtime.js.map
generated
vendored
Normal file
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
Loading…
Add table
Reference in a new issue