@superblocksteam/library 2.0.3-next.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +87 -0
- package/README.md +108 -0
- package/dist/allPaths-DyYm9YwR.js +17 -0
- package/dist/allPaths-DyYm9YwR.js.map +1 -0
- package/dist/allPaths-KD515okF.js +17 -0
- package/dist/allPaths-KD515okF.js.map +1 -0
- package/dist/allPathsLoader-ZiZSv3bC.js +22 -0
- package/dist/allPathsLoader-ZiZSv3bC.js.map +1 -0
- package/dist/allPathsLoader-fVkkn-jB.js +22 -0
- package/dist/allPathsLoader-fVkkn-jB.js.map +1 -0
- package/dist/icons-BrNMuu_I.js +40 -0
- package/dist/icons-BrNMuu_I.js.map +1 -0
- package/dist/index-BxzKdlqH.js +1353 -0
- package/dist/index-BxzKdlqH.js.map +1 -0
- package/dist/index-DBrh5TuF.js +195984 -0
- package/dist/index-DBrh5TuF.js.map +1 -0
- package/dist/index-DIJYif9G.js +1341 -0
- package/dist/index-DIJYif9G.js.map +1 -0
- package/dist/index-DIn-fanT.js +1353 -0
- package/dist/index-DIn-fanT.js.map +1 -0
- package/dist/index-LHtbj0-V.js +1341 -0
- package/dist/index-LHtbj0-V.js.map +1 -0
- package/dist/index.css +34465 -0
- package/dist/index.js +162 -0
- package/dist/index.js.map +1 -0
- package/dist/splitPathsBySizeLoader-BJsOSCsQ.js +34 -0
- package/dist/splitPathsBySizeLoader-BJsOSCsQ.js.map +1 -0
- package/dist/splitPathsBySizeLoader-CSiJpIs1.js +34 -0
- package/dist/splitPathsBySizeLoader-CSiJpIs1.js.map +1 -0
- package/dist-types/app-internal.d.ts +4 -0
- package/dist-types/docs-utils/generate-docs.d.ts +2 -0
- package/dist-types/edit-mode/collisions-layer.d.ts +3 -0
- package/dist-types/edit-mode/create-component.d.ts +8 -0
- package/dist-types/edit-mode/debug-tools.d.ts +11 -0
- package/dist-types/edit-mode/dnd/collision-detection.d.ts +3 -0
- package/dist-types/edit-mode/dnd/dnd-provider.d.ts +4 -0
- package/dist-types/edit-mode/dnd/draggable-widget.d.ts +7 -0
- package/dist-types/edit-mode/dnd/drop-layer.d.ts +5 -0
- package/dist-types/edit-mode/dnd/droppable-widget.d.ts +9 -0
- package/dist-types/edit-mode/dnd/grid-drop.d.ts +4 -0
- package/dist-types/edit-mode/dnd/grid-store.d.ts +31 -0
- package/dist-types/edit-mode/dnd/grid-utils.d.ts +8 -0
- package/dist-types/edit-mode/dnd/handle-grid-drop.d.ts +9 -0
- package/dist-types/edit-mode/dnd/handle-stack-drop.d.ts +9 -0
- package/dist-types/edit-mode/dnd/hooks/use-component-draggable.d.ts +5 -0
- package/dist-types/edit-mode/dnd/hooks/use-component-droppable.d.ts +6 -0
- package/dist-types/edit-mode/dnd/hooks/use-handle-dnd-events.d.ts +1 -0
- package/dist-types/edit-mode/dnd/hooks/use-widget-node-ref.d.ts +2 -0
- package/dist-types/edit-mode/dnd/new-components-drag-layer.d.ts +6 -0
- package/dist-types/edit-mode/dnd/stack-drop.d.ts +4 -0
- package/dist-types/edit-mode/dnd/stack-store.d.ts +10 -0
- package/dist-types/edit-mode/dnd/stack-utils.d.ts +13 -0
- package/dist-types/edit-mode/dnd/types.d.ts +45 -0
- package/dist-types/edit-mode/dnd/utils.d.ts +13 -0
- package/dist-types/edit-mode/duplicated-name-popover.d.ts +7 -0
- package/dist-types/edit-mode/edit-store.d.ts +28 -0
- package/dist-types/edit-mode/edit-wrapper.d.ts +17 -0
- package/dist-types/edit-mode/editor-hotkeys.d.ts +3 -0
- package/dist-types/edit-mode/features/connection-manager.d.ts +10 -0
- package/dist-types/edit-mode/features/drag-and-drop-store.d.ts +69 -0
- package/dist-types/edit-mode/features/interaction-layer-manager.d.ts +17 -0
- package/dist-types/edit-mode/features/operation-store.d.ts +49 -0
- package/dist-types/edit-mode/features/properties-panel-manager.d.ts +31 -0
- package/dist-types/edit-mode/features/resizing-store.d.ts +50 -0
- package/dist-types/edit-mode/features/runtime-entities-manager.d.ts +84 -0
- package/dist-types/edit-mode/features/runtime-widgets-manager.d.ts +51 -0
- package/dist-types/edit-mode/features/ui-store.d.ts +41 -0
- package/dist-types/edit-mode/hooks/use-register-source-element.d.ts +2 -0
- package/dist-types/edit-mode/iframe-wrappers.d.ts +4 -0
- package/dist-types/edit-mode/interaction-add-section-button.d.ts +4 -0
- package/dist-types/edit-mode/interaction-layer.d.ts +11 -0
- package/dist-types/edit-mode/interaction-rect-handles.d.ts +7 -0
- package/dist-types/edit-mode/interaction-rect-name-pill.d.ts +13 -0
- package/dist-types/edit-mode/interaction-rect.d.ts +44 -0
- package/dist-types/edit-mode/interaction-utils.d.ts +3 -0
- package/dist-types/edit-mode/mobx-sync/create-patch.d.ts +2 -0
- package/dist-types/edit-mode/mobx-sync/deep-observe.d.ts +24 -0
- package/dist-types/edit-mode/mobx-sync/mobx-editor-sync.d.ts +23 -0
- package/dist-types/edit-mode/properties.d.ts +13 -0
- package/dist-types/edit-mode/resize-capabilities.d.ts +5 -0
- package/dist-types/edit-mode/right-click-menu/right-click-menu.d.ts +13 -0
- package/dist-types/edit-mode/roots.d.ts +9 -0
- package/dist-types/edit-mode/runtime-children.d.ts +14 -0
- package/dist-types/edit-mode/sb-component-from-meta.d.ts +2 -0
- package/dist-types/edit-mode/source-update-api.d.ts +24 -0
- package/dist-types/edit-mode/superblocks-editor-bridge.d.ts +34 -0
- package/dist-types/internal-testing/components/api.d.ts +3 -0
- package/dist-types/internal-testing/components/button.d.ts +1 -0
- package/dist-types/internal-testing/components/checkbox.d.ts +1 -0
- package/dist-types/internal-testing/components/container.d.ts +1 -0
- package/dist-types/internal-testing/components/date-picker.d.ts +1 -0
- package/dist-types/internal-testing/components/dropdown.d.ts +1 -0
- package/dist-types/internal-testing/components/icon.d.ts +1 -0
- package/dist-types/internal-testing/components/image.d.ts +1 -0
- package/dist-types/internal-testing/components/input.d.ts +1 -0
- package/dist-types/internal-testing/components/key-value.d.ts +1 -0
- package/dist-types/internal-testing/components/modal.d.ts +1 -0
- package/dist-types/internal-testing/components/section-column.d.ts +1 -0
- package/dist-types/internal-testing/components/switch.d.ts +1 -0
- package/dist-types/internal-testing/components/table.d.ts +1 -0
- package/dist-types/internal-testing/components/timer.d.ts +3 -0
- package/dist-types/internal-testing/components/variable.d.ts +3 -0
- package/dist-types/internal-testing/utils.d.ts +5 -0
- package/dist-types/internal-testing/widgets.d.ts +2 -0
- package/dist-types/lib/hooks/use-alignment-styles.d.ts +9 -0
- package/dist-types/lib/hooks/use-cached-value.d.ts +11 -0
- package/dist-types/lib/hooks/use-callback-as-ref.d.ts +1 -0
- package/dist-types/lib/hooks/use-deep-memo.d.ts +9 -0
- package/dist-types/lib/hooks/use-editor-hotkeys.d.ts +3 -0
- package/dist-types/lib/hooks/use-element-rect.d.ts +7 -0
- package/dist-types/lib/hooks/use-observer-memo.d.ts +14 -0
- package/dist-types/lib/hooks/use-observer-memo.test.d.ts +1 -0
- package/dist-types/lib/hooks/use-pointer-down-outside.d.ts +15 -0
- package/dist-types/lib/hooks/use-stable-effect.d.ts +22 -0
- package/dist-types/lib/hooks/use-stable-effect.test.d.ts +1 -0
- package/dist-types/lib/index.d.ts +40 -0
- package/dist-types/lib/internal-details/actions-context.d.ts +9 -0
- package/dist-types/lib/internal-details/component-info-context.d.ts +10 -0
- package/dist-types/lib/internal-details/entities-state.d.ts +10 -0
- package/dist-types/lib/internal-details/entities.d.ts +5 -0
- package/dist-types/lib/internal-details/env.d.ts +1 -0
- package/dist-types/lib/internal-details/identifier-normalizer.d.ts +9 -0
- package/dist-types/lib/internal-details/is-sb-component.d.ts +7 -0
- package/dist-types/lib/internal-details/lib/devtools.d.ts +1 -0
- package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +104 -0
- package/dist-types/lib/internal-details/lib/evaluator/binding-extraction.d.ts +2 -0
- package/dist-types/lib/internal-details/lib/evaluator/binding-strings/transform-bindings.d.ts +6 -0
- package/dist-types/lib/internal-details/lib/evaluator/compute-engines.d.ts +20 -0
- package/dist-types/lib/internal-details/lib/evaluator/create-global-object.d.ts +7 -0
- package/dist-types/lib/internal-details/lib/evaluator/create-scope-proxy.d.ts +2 -0
- package/dist-types/lib/internal-details/lib/evaluator/deep-observe.d.ts +27 -0
- package/dist-types/lib/internal-details/lib/evaluator/entity-manager.d.ts +83 -0
- package/dist-types/lib/internal-details/lib/evaluator/entity-types.d.ts +16 -0
- package/dist-types/lib/internal-details/lib/evaluator/lazy-function.d.ts +7 -0
- package/dist-types/lib/internal-details/lib/evaluator/names.d.ts +7 -0
- package/dist-types/lib/internal-details/lib/evaluator/pretty-print-function.d.ts +2 -0
- package/dist-types/lib/internal-details/lib/evaluator/to-executables-or-values.d.ts +32 -0
- package/dist-types/lib/internal-details/lib/evaluator/use-shallow-mobx-observer.d.ts +1 -0
- package/dist-types/lib/internal-details/lib/evaluator/use-shallow-mobx-observer.test.d.ts +1 -0
- package/dist-types/lib/internal-details/lib/features/api-store.d.ts +31 -0
- package/dist-types/lib/internal-details/lib/features/api-utils.d.ts +77 -0
- package/dist-types/lib/internal-details/lib/features/component-registry.d.ts +29 -0
- package/dist-types/lib/internal-details/lib/features/injected-features.d.ts +8 -0
- package/dist-types/lib/internal-details/lib/features/name-manager.d.ts +36 -0
- package/dist-types/lib/internal-details/lib/iframe.d.ts +44 -0
- package/dist-types/lib/internal-details/lib/mobx-cached-getter.d.ts +1 -0
- package/dist-types/lib/internal-details/lib/resolve-id-singleton.d.ts +4 -0
- package/dist-types/lib/internal-details/lib/root-store.d.ts +30 -0
- package/dist-types/lib/internal-details/lib/throttle.d.ts +2 -0
- package/dist-types/lib/internal-details/lib/types.d.ts +229 -0
- package/dist-types/lib/internal-details/reactive-component.d.ts +10 -0
- package/dist-types/lib/internal-details/sb-wrapper-notes.d.ts +1 -0
- package/dist-types/lib/internal-details/sb-wrapper.d.ts +11 -0
- package/dist-types/lib/internal-details/scope/scope-context.d.ts +8 -0
- package/dist-types/lib/internal-details/scope/scope.d.ts +12 -0
- package/dist-types/lib/internal-details/size.d.ts +1 -0
- package/dist-types/lib/internal-details/theme-context.d.ts +8 -0
- package/dist-types/lib/internal-details/use-track-runtime-widget.d.ts +15 -0
- package/dist-types/lib/sb-trigger.d.ts +53 -0
- package/dist-types/lib/triggers/base.d.ts +17 -0
- package/dist-types/lib/triggers/implementations/apis/cancel-apis.d.ts +18 -0
- package/dist-types/lib/triggers/implementations/apis/run-apis.d.ts +21 -0
- package/dist-types/lib/triggers/implementations/components/control-modal.d.ts +17 -0
- package/dist-types/lib/triggers/implementations/components/control-slideout.d.ts +17 -0
- package/dist-types/lib/triggers/implementations/components/reset-component.d.ts +20 -0
- package/dist-types/lib/triggers/implementations/components/set-component-property.d.ts +20 -0
- package/dist-types/lib/triggers/implementations/navigate/navigate-to-app.d.ts +28 -0
- package/dist-types/lib/triggers/implementations/navigate/navigate-to-route.d.ts +23 -0
- package/dist-types/lib/triggers/implementations/navigate/navigate-to.d.ts +26 -0
- package/dist-types/lib/triggers/implementations/navigate/set-query-params.d.ts +18 -0
- package/dist-types/lib/triggers/implementations/run-js.d.ts +18 -0
- package/dist-types/lib/triggers/implementations/set-profile.d.ts +17 -0
- package/dist-types/lib/triggers/implementations/show-alert.d.ts +22 -0
- package/dist-types/lib/triggers/implementations/state/reset-state-var.d.ts +15 -0
- package/dist-types/lib/triggers/implementations/state/set-state-var.d.ts +18 -0
- package/dist-types/lib/triggers/implementations/timers/control-timer.d.ts +17 -0
- package/dist-types/lib/triggers/implementations/trigger-event.d.ts +17 -0
- package/dist-types/lib/triggers/registry.d.ts +174 -0
- package/dist-types/lib/triggers/run-event-handlers.d.ts +18 -0
- package/dist-types/lib/user-facing/component-base/components/autolinked-text.d.ts +8 -0
- package/dist-types/lib/user-facing/component-base/components/button.d.ts +46 -0
- package/dist-types/lib/user-facing/component-base/components/checkbox.d.ts +12 -0
- package/dist-types/lib/user-facing/component-base/components/dropdown-select.d.ts +4 -0
- package/dist-types/lib/user-facing/component-base/components/dynamic-svg.d.ts +10 -0
- package/dist-types/lib/user-facing/component-base/components/expand-button.d.ts +8 -0
- package/dist-types/lib/user-facing/component-base/components/loading-animator.d.ts +4 -0
- package/dist-types/lib/user-facing/component-base/components/plain-link.d.ts +1 -0
- package/dist-types/lib/user-facing/component-base/components/popper.d.ts +20 -0
- package/dist-types/lib/user-facing/component-base/components/search-component.d.ts +19 -0
- package/dist-types/lib/user-facing/component-base/components/span-trunc-middle.d.ts +9 -0
- package/dist-types/lib/user-facing/component-base/components/switch.d.ts +6 -0
- package/dist-types/lib/user-facing/component-base/constants.d.ts +18 -0
- package/dist-types/lib/user-facing/component-base/error/error-inline-message.d.ts +36 -0
- package/dist-types/lib/user-facing/component-base/error/error-tooltip.d.ts +11 -0
- package/dist-types/lib/user-facing/component-base/error/error-utils.d.ts +13 -0
- package/dist-types/lib/user-facing/component-base/error/widget-errors-wrapper.d.ts +15 -0
- package/dist-types/lib/user-facing/component-base/error-boundary.d.ts +18 -0
- package/dist-types/lib/user-facing/component-base/sb-component.d.ts +18 -0
- package/dist-types/lib/user-facing/component-base/styles/button-styles.d.ts +16 -0
- package/dist-types/lib/user-facing/component-base/styles/hover-styles.d.ts +10 -0
- package/dist-types/lib/user-facing/component-base/styles/input-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/component-base/use-passthrough-props.d.ts +6 -0
- package/dist-types/lib/user-facing/component-base/utils/format-utils.d.ts +37 -0
- package/dist-types/lib/user-facing/component-base/utils/input-validation.d.ts +17 -0
- package/dist-types/lib/user-facing/components/button/index.d.ts +37 -0
- package/dist-types/lib/user-facing/components/button/props.d.ts +48 -0
- package/dist-types/lib/user-facing/components/checkbox/checkbox-component.d.ts +9 -0
- package/dist-types/lib/user-facing/components/checkbox/constants.d.ts +2 -0
- package/dist-types/lib/user-facing/components/checkbox/index.d.ts +43 -0
- package/dist-types/lib/user-facing/components/checkbox/props.d.ts +44 -0
- package/dist-types/lib/user-facing/components/checkbox/types.d.ts +19 -0
- package/dist-types/lib/user-facing/components/column/index.d.ts +51 -0
- package/dist-types/lib/user-facing/components/column/props.d.ts +45 -0
- package/dist-types/lib/user-facing/components/container/index.d.ts +63 -0
- package/dist-types/lib/user-facing/components/container/props.d.ts +58 -0
- package/dist-types/lib/user-facing/components/custom/context.d.ts +11 -0
- package/dist-types/lib/user-facing/components/custom/index.d.ts +2 -0
- package/dist-types/lib/user-facing/components/custom/register-custom-component.d.ts +27 -0
- package/dist-types/lib/user-facing/components/date-picker/constants.d.ts +8 -0
- package/dist-types/lib/user-facing/components/date-picker/date-picker-component.d.ts +29 -0
- package/dist-types/lib/user-facing/components/date-picker/date-picker.d.ts +2 -0
- package/dist-types/lib/user-facing/components/date-picker/index.d.ts +62 -0
- package/dist-types/lib/user-facing/components/date-picker/props.d.ts +64 -0
- package/dist-types/lib/user-facing/components/date-picker/props.test-d.d.ts +1 -0
- package/dist-types/lib/user-facing/components/date-picker/side-effects.d.ts +3 -0
- package/dist-types/lib/user-facing/components/date-picker/types.d.ts +40 -0
- package/dist-types/lib/user-facing/components/date-picker/utils.d.ts +24 -0
- package/dist-types/lib/user-facing/components/dropdown/constants.d.ts +5 -0
- package/dist-types/lib/user-facing/components/dropdown/dropdown-component.d.ts +106 -0
- package/dist-types/lib/user-facing/components/dropdown/index.d.ts +73 -0
- package/dist-types/lib/user-facing/components/dropdown/multi-dropdown.d.ts +18 -0
- package/dist-types/lib/user-facing/components/dropdown/normalize-values.d.ts +2 -0
- package/dist-types/lib/user-facing/components/dropdown/props.d.ts +76 -0
- package/dist-types/lib/user-facing/components/dropdown/types.d.ts +89 -0
- package/dist-types/lib/user-facing/components/dropdown/utils.d.ts +8 -0
- package/dist-types/lib/user-facing/components/grid/calculations/calculate-constraints.d.ts +26 -0
- package/dist-types/lib/user-facing/components/grid/calculations/calculate-row-positions.d.ts +2 -0
- package/dist-types/lib/user-facing/components/grid/calculations/order-constraints.d.ts +2 -0
- package/dist-types/lib/user-facing/components/grid/index.d.ts +36 -0
- package/dist-types/lib/user-facing/components/grid/use-height-observer.d.ts +5 -0
- package/dist-types/lib/user-facing/components/grid/utils.d.ts +1 -0
- package/dist-types/lib/user-facing/components/icon/index.d.ts +25 -0
- package/dist-types/lib/user-facing/components/icon/props.d.ts +26 -0
- package/dist-types/lib/user-facing/components/image/image-component.d.ts +38 -0
- package/dist-types/lib/user-facing/components/image/index.d.ts +29 -0
- package/dist-types/lib/user-facing/components/image/props.d.ts +39 -0
- package/dist-types/lib/user-facing/components/input/constants.d.ts +24 -0
- package/dist-types/lib/user-facing/components/input/derived-properties.d.ts +5 -0
- package/dist-types/lib/user-facing/components/input/index.d.ts +97 -0
- package/dist-types/lib/user-facing/components/input/input-component.d.ts +60 -0
- package/dist-types/lib/user-facing/components/input/props.d.ts +101 -0
- package/dist-types/lib/user-facing/components/input/styles.d.ts +6 -0
- package/dist-types/lib/user-facing/components/input/types.d.ts +45 -0
- package/dist-types/lib/user-facing/components/input/utils.d.ts +15 -0
- package/dist-types/lib/user-facing/components/key-value/components/key-styles.d.ts +3 -0
- package/dist-types/lib/user-facing/components/key-value/components/property-key.d.ts +7 -0
- package/dist-types/lib/user-facing/components/key-value/components/property-value.d.ts +12 -0
- package/dist-types/lib/user-facing/components/key-value/components/value-styles.d.ts +6 -0
- package/dist-types/lib/user-facing/components/key-value/constants.d.ts +7 -0
- package/dist-types/lib/user-facing/components/key-value/derived-properties.d.ts +1 -0
- package/dist-types/lib/user-facing/components/key-value/index.d.ts +39 -0
- package/dist-types/lib/user-facing/components/key-value/key-value-component.d.ts +2 -0
- package/dist-types/lib/user-facing/components/key-value/properties-props.d.ts +45 -0
- package/dist-types/lib/user-facing/components/key-value/props.d.ts +38 -0
- package/dist-types/lib/user-facing/components/key-value/styles.d.ts +22 -0
- package/dist-types/lib/user-facing/components/key-value/types.d.ts +106 -0
- package/dist-types/lib/user-facing/components/key-value/utils.d.ts +11 -0
- package/dist-types/lib/user-facing/components/modal/constants.d.ts +8 -0
- package/dist-types/lib/user-facing/components/modal/index.d.ts +49 -0
- package/dist-types/lib/user-facing/components/modal/modal-component.d.ts +36 -0
- package/dist-types/lib/user-facing/components/modal/props.d.ts +46 -0
- package/dist-types/lib/user-facing/components/page/index.d.ts +18 -0
- package/dist-types/lib/user-facing/components/page/props.d.ts +19 -0
- package/dist-types/lib/user-facing/components/page/register-page.d.ts +2 -0
- package/dist-types/lib/user-facing/components/section/index.d.ts +19 -0
- package/dist-types/lib/user-facing/components/section/props.d.ts +22 -0
- package/dist-types/lib/user-facing/components/slideout/index.d.ts +15 -0
- package/dist-types/lib/user-facing/components/slideout/props.d.ts +15 -0
- package/dist-types/lib/user-facing/components/stack/index.d.ts +60 -0
- package/dist-types/lib/user-facing/components/switch/constants.d.ts +3 -0
- package/dist-types/lib/user-facing/components/switch/index.d.ts +44 -0
- package/dist-types/lib/user-facing/components/switch/props.d.ts +45 -0
- package/dist-types/lib/user-facing/components/switch/switch-component.d.ts +4 -0
- package/dist-types/lib/user-facing/components/switch/types.d.ts +19 -0
- package/dist-types/lib/user-facing/components/table/column-properties-panel.d.ts +245 -0
- package/dist-types/lib/user-facing/components/table/components/autotooltip-component.d.ts +17 -0
- package/dist-types/lib/user-facing/components/table/components/boolean-value-icons.d.ts +16 -0
- package/dist-types/lib/user-facing/components/table/components/column-settings.d.ts +11 -0
- package/dist-types/lib/user-facing/components/table/components/edit-cell.d.ts +15 -0
- package/dist-types/lib/user-facing/components/table/components/edit-checkbox-cell.d.ts +11 -0
- package/dist-types/lib/user-facing/components/table/components/edit-date-cell.d.ts +12 -0
- package/dist-types/lib/user-facing/components/table/components/edit-input-cell.d.ts +14 -0
- package/dist-types/lib/user-facing/components/table/components/edit-multi-select-cell.d.ts +13 -0
- package/dist-types/lib/user-facing/components/table/components/edit-single-select-cell.d.ts +13 -0
- package/dist-types/lib/user-facing/components/table/components/edit-utils.d.ts +28 -0
- package/dist-types/lib/user-facing/components/table/components/editable-link-cell.d.ts +20 -0
- package/dist-types/lib/user-facing/components/table/components/filter-popover-content.d.ts +37 -0
- package/dist-types/lib/user-facing/components/table/components/popover-video.d.ts +5 -0
- package/dist-types/lib/user-facing/components/table/components/table-action-icon.d.ts +13 -0
- package/dist-types/lib/user-facing/components/table/components/table-column-header-button.d.ts +19 -0
- package/dist-types/lib/user-facing/components/table/components/table-data-download.d.ts +15 -0
- package/dist-types/lib/user-facing/components/table/components/table-footer.d.ts +40 -0
- package/dist-types/lib/user-facing/components/table/components/table-header.d.ts +62 -0
- package/dist-types/lib/user-facing/components/table/components/table-loading-state.d.ts +11 -0
- package/dist-types/lib/user-facing/components/table/components/table-pagination-input.d.ts +10 -0
- package/dist-types/lib/user-facing/components/table/components/table-pagination.d.ts +18 -0
- package/dist-types/lib/user-facing/components/table/components/table-row-context-menu.d.ts +17 -0
- package/dist-types/lib/user-facing/components/table/components/table-tag.d.ts +25 -0
- package/dist-types/lib/user-facing/components/table/constants.d.ts +111 -0
- package/dist-types/lib/user-facing/components/table/derived-properties.d.ts +20 -0
- package/dist-types/lib/user-facing/components/table/index.d.ts +338 -0
- package/dist-types/lib/user-facing/components/table/props.d.ts +342 -0
- package/dist-types/lib/user-facing/components/table/table-component.d.ts +100 -0
- package/dist-types/lib/user-facing/components/table/table-manager.d.ts +23 -0
- package/dist-types/lib/user-facing/components/table/table-styles.d.ts +78 -0
- package/dist-types/lib/user-facing/components/table/table-utilities.d.ts +147 -0
- package/dist-types/lib/user-facing/components/table/table-widget.d.ts +148 -0
- package/dist-types/lib/user-facing/components/table/types.d.ts +471 -0
- package/dist-types/lib/user-facing/components/table/use-sticky.d.ts +1 -0
- package/dist-types/lib/user-facing/components/table/utils.d.ts +2 -0
- package/dist-types/lib/user-facing/components/text/index.d.ts +51 -0
- package/dist-types/lib/user-facing/components/text/long-text-button.d.ts +8 -0
- package/dist-types/lib/user-facing/components/text/props.d.ts +60 -0
- package/dist-types/lib/user-facing/components/text/styles.d.ts +2 -0
- package/dist-types/lib/user-facing/components/text/utils.d.ts +25 -0
- package/dist-types/lib/user-facing/constants.d.ts +2 -0
- package/dist-types/lib/user-facing/entities/api/index.d.ts +14 -0
- package/dist-types/lib/user-facing/entities/api/props.d.ts +15 -0
- package/dist-types/lib/user-facing/entities/timer/index.d.ts +16 -0
- package/dist-types/lib/user-facing/entities/timer/props.d.ts +19 -0
- package/dist-types/lib/user-facing/entities/variable/index.d.ts +14 -0
- package/dist-types/lib/user-facing/entities/variable/props.d.ts +13 -0
- package/dist-types/lib/user-facing/global-functions.d.ts +23 -0
- package/dist-types/lib/user-facing/hooks/use-editor.d.ts +42 -0
- package/dist-types/lib/user-facing/hooks/use-update-properties.d.ts +1 -0
- package/dist-types/lib/user-facing/icons/constants.d.ts +8 -0
- package/dist-types/lib/user-facing/icons/encoded.d.ts +1 -0
- package/dist-types/lib/user-facing/icons/helpers.d.ts +21 -0
- package/dist-types/lib/user-facing/icons/index.d.ts +2 -0
- package/dist-types/lib/user-facing/internal-index.d.ts +4 -0
- package/dist-types/lib/user-facing/layers.d.ts +43 -0
- package/dist-types/lib/user-facing/properties-panel/constants.d.ts +1 -0
- package/dist-types/lib/user-facing/properties-panel/create-managed-props-list.d.ts +5 -0
- package/dist-types/lib/user-facing/properties-panel/mixins/appearance-properties.d.ts +21 -0
- package/dist-types/lib/user-facing/properties-panel/mixins/appearance.d.ts +12 -0
- package/dist-types/lib/user-facing/properties-panel/mixins/form-inputs-properties.d.ts +44 -0
- package/dist-types/lib/user-facing/properties-panel/mixins/layout-section.d.ts +114 -0
- package/dist-types/lib/user-facing/properties-panel/properties-panel-definition.d.ts +6 -0
- package/dist-types/lib/user-facing/properties-panel/props-builder.d.ts +253 -0
- package/dist-types/lib/user-facing/properties-panel/props-builder.test-d.d.ts +1 -0
- package/dist-types/lib/user-facing/properties-panel/props-panel-utils.d.ts +3 -0
- package/dist-types/lib/user-facing/properties-panel/validators.d.ts +33 -0
- package/dist-types/lib/user-facing/sb-event-flow.d.ts +52 -0
- package/dist-types/lib/user-facing/sb-provider.d.ts +12 -0
- package/dist-types/lib/user-facing/state/create-bindable-entity-proxy.d.ts +6 -0
- package/dist-types/lib/user-facing/state/create-scope.d.ts +6 -0
- package/dist-types/lib/user-facing/state/sb-computed.d.ts +2 -0
- package/dist-types/lib/user-facing/state/types.d.ts +17 -0
- package/dist-types/lib/user-facing/styling/color-utils.d.ts +13 -0
- package/dist-types/lib/user-facing/styling/colors.d.ts +67 -0
- package/dist-types/lib/user-facing/styling/style-as-class.d.ts +1 -0
- package/dist-types/lib/user-facing/styling/styles.d.ts +4 -0
- package/dist-types/lib/user-facing/styling/widget-label-styles.d.ts +11 -0
- package/dist-types/lib/user-facing/themes/classnames.d.ts +72 -0
- package/dist-types/lib/user-facing/themes/constants.d.ts +80 -0
- package/dist-types/lib/user-facing/themes/default-theme.d.ts +8 -0
- package/dist-types/lib/user-facing/themes/generate-border-css.d.ts +25 -0
- package/dist-types/lib/user-facing/themes/generate-border-styles.d.ts +15 -0
- package/dist-types/lib/user-facing/themes/generate-class-name.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generate-colors.d.ts +45 -0
- package/dist-types/lib/user-facing/themes/generate-theme.d.ts +3 -0
- package/dist-types/lib/user-facing/themes/generate-typographies.d.ts +5 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/button-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/container-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/datepicker-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/dropdown-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/editor-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/generate-component-styles.d.ts +16 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/generate-padding-style.d.ts +19 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/icon-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/input-styles.d.ts +3 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/paginator-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/popper-styles.d.ts +2 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/styles-utils.d.ts +1 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/text-styles.d.ts +3 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/theme-styles.d.ts +5 -0
- package/dist-types/lib/user-facing/themes/generatedStyles/utils.d.ts +23 -0
- package/dist-types/lib/user-facing/themes/index.d.ts +5 -0
- package/dist-types/lib/user-facing/themes/layers.d.ts +6 -0
- package/dist-types/lib/user-facing/themes/padding-constants.d.ts +10 -0
- package/dist-types/lib/user-facing/themes/typeface-constants.d.ts +3 -0
- package/dist-types/lib/user-facing/themes/typefaces/utils.d.ts +28 -0
- package/dist-types/lib/user-facing/themes/typeography/typography-utils.d.ts +33 -0
- package/dist-types/lib/user-facing/themes/typeography/use-typography-styling.d.ts +15 -0
- package/dist-types/lib/user-facing/themes/typography-constants.d.ts +34 -0
- package/dist-types/lib/user-facing/themes/utils.d.ts +16 -0
- package/dist-types/lib/user-facing/types.d.ts +22 -0
- package/dist-types/lib/user-facing/utils/form.d.ts +10 -0
- package/dist-types/lib/utils/clean-object.d.ts +5 -0
- package/dist-types/lib/utils/fast-clone.d.ts +1 -0
- package/dist-types/lib/utils/generate-id.d.ts +1 -0
- package/dist-types/lib/utils/is-user-on-mac.d.ts +1 -0
- package/dist-types/lib/utils/is-widget-grid.d.ts +2 -0
- package/dist-types/lib/utils/is-widget-vstack.d.ts +2 -0
- package/dist-types/lib/utils/shallow-equal.d.ts +1 -0
- package/dist-types/lib/utils/widget-wrapper-naming.d.ts +6 -0
- package/dist-types/main.d.ts +1 -0
- package/package.json +152 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { GridManager } from "../dnd/grid-store.js";
|
|
2
|
+
import { StackManager } from "../dnd/stack-store.js";
|
|
3
|
+
import type { RootStore } from "../../lib/internal-details/lib/root-store.js";
|
|
4
|
+
import type { ClientRect } from "@dnd-kit/core";
|
|
5
|
+
import type { SbElement, SbInstance } from "@superblocksteam/library-shared/types";
|
|
6
|
+
type DNDFeatures = {
|
|
7
|
+
dragAndDrop?: boolean;
|
|
8
|
+
nudging?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare class DragAndDropManager {
|
|
11
|
+
private root;
|
|
12
|
+
stack: StackManager;
|
|
13
|
+
grid: GridManager;
|
|
14
|
+
private _dropTargetInstanceId;
|
|
15
|
+
private _isDragging;
|
|
16
|
+
private _isDraggingNewComponent;
|
|
17
|
+
private _activeDragRect;
|
|
18
|
+
private _activeTargetRect;
|
|
19
|
+
private _draggingWidgetSize;
|
|
20
|
+
private _dragToCanvasComponentType;
|
|
21
|
+
private _validRootIds;
|
|
22
|
+
private _shouldResizePage;
|
|
23
|
+
private _invalidDropTarget;
|
|
24
|
+
private _perWidgetFeatures;
|
|
25
|
+
widgetPositions: Record<SbInstance, ClientRect>;
|
|
26
|
+
constructor(root: RootStore);
|
|
27
|
+
get isDragging(): boolean;
|
|
28
|
+
get isDraggingNewComponent(): boolean;
|
|
29
|
+
get draggingWidgetSize(): {
|
|
30
|
+
height: number;
|
|
31
|
+
width: number;
|
|
32
|
+
};
|
|
33
|
+
get dropTargetId(): `I-${string}` | null;
|
|
34
|
+
get activeDragRect(): ClientRect | null;
|
|
35
|
+
get activeTargetRect(): ClientRect | null;
|
|
36
|
+
get shouldResizePage(): boolean;
|
|
37
|
+
get dropTargetWidgetType(): string | undefined;
|
|
38
|
+
get isDropTargetGridLike(): boolean;
|
|
39
|
+
get isDropTargetStackLike(): boolean;
|
|
40
|
+
get draggedWidgetType(): string | null | undefined;
|
|
41
|
+
get dragToCanvasComponentType(): string | null;
|
|
42
|
+
get validRootIds(): `I-${string}`[] | null;
|
|
43
|
+
get invalidDropTarget(): boolean;
|
|
44
|
+
canDragWidget(instanceId: SbInstance): boolean;
|
|
45
|
+
canNudgeWidget(instanceId: SbInstance): boolean;
|
|
46
|
+
setWidgetFeatures(id: SbElement, features: Partial<DNDFeatures>): void;
|
|
47
|
+
setIsDragging(isDragging: boolean): void;
|
|
48
|
+
/**
|
|
49
|
+
* Indicates a drag of a new component into the canvas (e.g: from the sidebar)
|
|
50
|
+
* Used to handle the dragging preview, and the drop handling
|
|
51
|
+
*/
|
|
52
|
+
startNewComponentDrag({ height, width, componentType, }: {
|
|
53
|
+
height: number;
|
|
54
|
+
width: number;
|
|
55
|
+
componentType: string | null;
|
|
56
|
+
}): void;
|
|
57
|
+
cancelNewComponentDrag(): void;
|
|
58
|
+
setValidRootIds(ids: SbInstance[]): void;
|
|
59
|
+
setInvalidDropTarget(invalid: boolean): void;
|
|
60
|
+
setDropTargetId(id: SbInstance | null): void;
|
|
61
|
+
setActiveDragRect(collidingRect: ClientRect | null): void;
|
|
62
|
+
setActiveTargetRect(rect: ClientRect | null): void;
|
|
63
|
+
setWidgetPosition(id: SbInstance, rect: ClientRect | null): void;
|
|
64
|
+
updateChildPositions(id: SbInstance): void;
|
|
65
|
+
private getPageElement;
|
|
66
|
+
resizePageIfNeeded(): void;
|
|
67
|
+
private restorePageDimensions;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SbElement, SbInstance } from "@superblocksteam/library-shared/types";
|
|
2
|
+
declare class InteractionLayerManager {
|
|
3
|
+
/**
|
|
4
|
+
* The id of the root element that is currently being interacted with
|
|
5
|
+
* the root can be SbPage, SbModal or SbSlideout
|
|
6
|
+
* If set to undefined, the interaction layer will be the SbPage
|
|
7
|
+
* if set to the detached component id, the inteactoin layer will be disabled on the page
|
|
8
|
+
*/
|
|
9
|
+
activeRootInstanceId: SbInstance | undefined;
|
|
10
|
+
sourceIdElements: Map<HTMLElement, `SB-${string}`>;
|
|
11
|
+
constructor();
|
|
12
|
+
setActiveRootInstanceId(rootInstanceId: SbInstance | undefined): void;
|
|
13
|
+
setSourceIdElement(element: HTMLElement, sourceId: SbElement): void;
|
|
14
|
+
removeSourceIdElement(element: HTMLElement): void;
|
|
15
|
+
getSourceIdElements(sourceId: SbElement): HTMLElement[];
|
|
16
|
+
}
|
|
17
|
+
export default InteractionLayerManager;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { PropertyInfo, ReparentRequest, SbElement, SetPropertiesRequest, SetPropertyRequest, SourceLocation } from "@superblocksteam/library-shared/types";
|
|
2
|
+
export type ReparentTransaction = {
|
|
3
|
+
type: "reparent";
|
|
4
|
+
id: string;
|
|
5
|
+
affectedSourceIds: string[];
|
|
6
|
+
payload: Omit<ReparentRequest, "transaction">;
|
|
7
|
+
callback?: () => void;
|
|
8
|
+
};
|
|
9
|
+
type SetPropertiesTransaction = {
|
|
10
|
+
type: "setProperties";
|
|
11
|
+
id: string;
|
|
12
|
+
sourceId: string;
|
|
13
|
+
payload: Omit<SetPropertiesRequest, "transaction">;
|
|
14
|
+
callback?: () => void;
|
|
15
|
+
};
|
|
16
|
+
type SetPropertyTransaction = {
|
|
17
|
+
type: "setProperty";
|
|
18
|
+
id: string;
|
|
19
|
+
sourceId: string;
|
|
20
|
+
payload: Omit<SetPropertyRequest, "transaction">;
|
|
21
|
+
callback?: () => void;
|
|
22
|
+
};
|
|
23
|
+
type PendingTransaction = ReparentTransaction | SetPropertiesTransaction | SetPropertyTransaction;
|
|
24
|
+
declare class OperationManager {
|
|
25
|
+
private pendingTransactions;
|
|
26
|
+
visibleSourceIds: string[];
|
|
27
|
+
constructor();
|
|
28
|
+
get allPendingTransactions(): PendingTransaction[];
|
|
29
|
+
get pendingReparentOperations(): ReparentTransaction[];
|
|
30
|
+
get pendingSetPropertiesOperations(): SetPropertiesTransaction[];
|
|
31
|
+
get pendingSetPropertyOperations(): SetPropertyTransaction[];
|
|
32
|
+
get allNames(): never[];
|
|
33
|
+
private addPendingTransaction;
|
|
34
|
+
clearPendingTransactions(transactionIds: string[]): void;
|
|
35
|
+
dropComponent(action: {
|
|
36
|
+
from: {
|
|
37
|
+
source: SourceLocation;
|
|
38
|
+
};
|
|
39
|
+
to: {
|
|
40
|
+
source: SourceLocation;
|
|
41
|
+
};
|
|
42
|
+
propsToChange?: Record<string, PropertyInfo>;
|
|
43
|
+
}): void;
|
|
44
|
+
writeRuntimeProperties(sourceId: SbElement, transactionId: string, updates: Record<string, PropertyInfo<unknown>>): void;
|
|
45
|
+
setWidgetProperties(sourceId: SbElement, properties: Record<string, PropertyInfo<unknown>>, callback?: () => void): void;
|
|
46
|
+
setWidgetProperty(sourceId: SbElement, property: string, value: PropertyInfo<unknown>, callback?: () => void): void;
|
|
47
|
+
ensureFilesSynced(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
export default OperationManager;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type PropertyInfo, type SbElement, type SbInstance } from "@superblocksteam/library-shared/types";
|
|
2
|
+
import type RuntimeEntitiesManager from "./runtime-entities-manager.js";
|
|
3
|
+
import type { IEntityManager } from "../../lib/internal-details/lib/evaluator/base-entity-manager.js";
|
|
4
|
+
import type { PropertiesDefinition } from "../../lib/user-facing/properties-panel/props-builder.js";
|
|
5
|
+
import type { PropertiesPanelDefinition } from "@superblocksteam/library-shared/props";
|
|
6
|
+
declare class PropertiesPanelManager {
|
|
7
|
+
readonly runtimeEntitiesManager: RuntimeEntitiesManager;
|
|
8
|
+
readonly entityManager: IEntityManager;
|
|
9
|
+
private propertiesDefinitions;
|
|
10
|
+
private propertiesPanelTrackerDisposer;
|
|
11
|
+
private nonDynamicPropertyPanels;
|
|
12
|
+
constructor(runtimeEntitiesManager: RuntimeEntitiesManager, entityManager: IEntityManager);
|
|
13
|
+
getPropertiesPanel(scopeId: string, instanceId: SbInstance): PropertiesPanelDefinition;
|
|
14
|
+
trackPropertiesPanel(scopeId: string, instanceId: SbInstance, sourceId: string): void;
|
|
15
|
+
getPropertiesDefinition(type: string): PropertiesDefinition | undefined;
|
|
16
|
+
setPropertiesDefinition(widgetType: string, propertiesDefinition: PropertiesDefinition): void;
|
|
17
|
+
getNonDynamicPropertiesPanels(): {
|
|
18
|
+
[k: string]: PropertiesPanelDefinition;
|
|
19
|
+
};
|
|
20
|
+
private _propertyLookupCache;
|
|
21
|
+
private cachedPropertyLookupForType;
|
|
22
|
+
private getPropertyForPath;
|
|
23
|
+
computeSideEffectsForPropertyUpdate(payload: {
|
|
24
|
+
sourceId: SbElement;
|
|
25
|
+
updates: Record<string, PropertyInfo<unknown>>;
|
|
26
|
+
}): Record<string, {
|
|
27
|
+
props?: Record<string, PropertyInfo<unknown>>;
|
|
28
|
+
meta?: Record<string, unknown>;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export default PropertiesPanelManager;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Dim } from "@superblocksteam/library-shared";
|
|
2
|
+
import type { SbElement, SbInstance } from "@superblocksteam/library-shared/types";
|
|
3
|
+
type GU = {
|
|
4
|
+
xGU: number;
|
|
5
|
+
yGU: number;
|
|
6
|
+
widthGU: number;
|
|
7
|
+
heightGU: number;
|
|
8
|
+
};
|
|
9
|
+
type ResizeState = {
|
|
10
|
+
instanceId: SbInstance;
|
|
11
|
+
sourceId: SbElement;
|
|
12
|
+
dragStartX: number;
|
|
13
|
+
dragStartY: number;
|
|
14
|
+
start: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
marginLeft: number;
|
|
18
|
+
marginTop: number;
|
|
19
|
+
};
|
|
20
|
+
resizedPosition: string;
|
|
21
|
+
widthToUpdate: Dim | null;
|
|
22
|
+
marginLeftToUpdate: Dim | null;
|
|
23
|
+
heightToUpdate: Dim | null;
|
|
24
|
+
marginTopToUpdate: Dim | null;
|
|
25
|
+
gridUnitWidth: number;
|
|
26
|
+
gridUnitHeight: number;
|
|
27
|
+
potentialCollisions: Record<SbInstance, GU>;
|
|
28
|
+
widgetGU: GU | null;
|
|
29
|
+
isApplyingResize: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare class ResizingManager {
|
|
32
|
+
private _activeResizes;
|
|
33
|
+
constructor();
|
|
34
|
+
startResizing(dragStartX: number, dragStartY: number, instanceId: SbInstance, position: string): void;
|
|
35
|
+
private calculatePotentialCollisions;
|
|
36
|
+
private calculateDimension;
|
|
37
|
+
private handleResizeDimension;
|
|
38
|
+
private isColliding;
|
|
39
|
+
resizeWidget(currentX: number, currentY: number, instanceId: SbInstance, canResizeWidth: boolean, canResizeHeight: boolean): void;
|
|
40
|
+
pendingResize(sourceId: SbElement): {
|
|
41
|
+
width: Dim | null;
|
|
42
|
+
height: Dim | null;
|
|
43
|
+
marginLeft: Dim | null;
|
|
44
|
+
marginTop: Dim | null;
|
|
45
|
+
} | null;
|
|
46
|
+
get hasAnyPendingResize(): boolean;
|
|
47
|
+
get pendingResizes(): ResizeState[];
|
|
48
|
+
applyResize(instanceId: SbInstance): void;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import RuntimeWidgetsManager from "./runtime-widgets-manager.js";
|
|
2
|
+
import type { ChildElement, RuntimeWidgetMeta } from "./runtime-widgets-manager.js";
|
|
3
|
+
import type { IEntityManager } from "../../lib/internal-details/lib/evaluator/base-entity-manager.js";
|
|
4
|
+
import type { IdentifierInfo, NameManager } from "../../lib/internal-details/lib/features/name-manager.js";
|
|
5
|
+
import type { SbElement, SbInstance } from "@superblocksteam/library-shared/types";
|
|
6
|
+
declare class RuntimeEntitiesManager {
|
|
7
|
+
readonly nameManager: NameManager;
|
|
8
|
+
readonly entityManager: IEntityManager;
|
|
9
|
+
widgets: RuntimeWidgetsManager;
|
|
10
|
+
entitiesWithLocalBindings: Set<string>;
|
|
11
|
+
constructor(nameManager: NameManager, entityManager: IEntityManager);
|
|
12
|
+
processRootWidget(params: {
|
|
13
|
+
rootIdentifier: IdentifierInfo;
|
|
14
|
+
rootProps: Record<string, unknown>;
|
|
15
|
+
rootType: string;
|
|
16
|
+
fallbackScopeId: string;
|
|
17
|
+
isInCustomComponent: boolean;
|
|
18
|
+
}): void;
|
|
19
|
+
private getOptimisticWidgetMeta;
|
|
20
|
+
getEditorWidgetMeta(instanceId: SbInstance): RuntimeWidgetMeta | undefined;
|
|
21
|
+
getEditorWidgetSourceId(instanceId: SbInstance): `SB-${string}` | undefined;
|
|
22
|
+
getEditorWidgetScopeId(instanceId: SbInstance): string | undefined;
|
|
23
|
+
getAnyEditorWidgetMeta(sourceId: SbElement): RuntimeWidgetMeta | undefined;
|
|
24
|
+
getEditorWidgetName(instanceId: SbInstance): string | undefined;
|
|
25
|
+
getEditorWidgetType(instanceId: SbInstance): string | undefined;
|
|
26
|
+
getEditorWidgetChildrenMeta(instanceId: SbInstance): Array<RuntimeWidgetMeta>;
|
|
27
|
+
setEntitiesWithLocalBindings(entities: string[]): void;
|
|
28
|
+
doesEntityHaveLocalBindings(entity: SbInstance): boolean;
|
|
29
|
+
private getOptimisticWidgetChildrenIds;
|
|
30
|
+
private getParentSourceId;
|
|
31
|
+
private get relevantChildrenOperationsMap();
|
|
32
|
+
private getChildrenWithOptimisticUpdates;
|
|
33
|
+
getEditorWidgetChildren(instanceId: SbInstance): ChildElement[];
|
|
34
|
+
get hasEditOperationsPending(): boolean;
|
|
35
|
+
get getPendingOperations(): ((import("./operation-store.js").ReparentTransaction | {
|
|
36
|
+
type: "setProperties";
|
|
37
|
+
id: string;
|
|
38
|
+
sourceId: string;
|
|
39
|
+
payload: Omit<import("@superblocksteam/library-shared/types").SetPropertiesRequest, "transaction">;
|
|
40
|
+
callback?: () => void;
|
|
41
|
+
} | {
|
|
42
|
+
type: "setProperty";
|
|
43
|
+
id: string;
|
|
44
|
+
sourceId: string;
|
|
45
|
+
payload: Omit<import("@superblocksteam/library-shared/types").SetPropertyRequest, "transaction">;
|
|
46
|
+
callback?: () => void;
|
|
47
|
+
}) | {
|
|
48
|
+
instanceId: SbInstance;
|
|
49
|
+
sourceId: SbElement;
|
|
50
|
+
dragStartX: number;
|
|
51
|
+
dragStartY: number;
|
|
52
|
+
start: {
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
marginLeft: number;
|
|
56
|
+
marginTop: number;
|
|
57
|
+
};
|
|
58
|
+
resizedPosition: string;
|
|
59
|
+
widthToUpdate: import("@superblocksteam/library-shared").Dim | null;
|
|
60
|
+
marginLeftToUpdate: import("@superblocksteam/library-shared").Dim | null;
|
|
61
|
+
heightToUpdate: import("@superblocksteam/library-shared").Dim | null;
|
|
62
|
+
marginTopToUpdate: import("@superblocksteam/library-shared").Dim | null;
|
|
63
|
+
gridUnitWidth: number;
|
|
64
|
+
gridUnitHeight: number;
|
|
65
|
+
potentialCollisions: Record<SbInstance, {
|
|
66
|
+
xGU: number;
|
|
67
|
+
yGU: number;
|
|
68
|
+
widthGU: number;
|
|
69
|
+
heightGU: number;
|
|
70
|
+
}>;
|
|
71
|
+
widgetGU: {
|
|
72
|
+
xGU: number;
|
|
73
|
+
yGU: number;
|
|
74
|
+
widthGU: number;
|
|
75
|
+
heightGU: number;
|
|
76
|
+
} | null;
|
|
77
|
+
isApplyingResize: boolean;
|
|
78
|
+
})[];
|
|
79
|
+
getScopeIdForSourceId(sourceId: SbElement): string | undefined;
|
|
80
|
+
applySideEffects(changes: Record<string, Record<string, unknown>>, scopeId: string): void;
|
|
81
|
+
isChildOf(childId: SbInstance, parentId: SbInstance): boolean;
|
|
82
|
+
getClosestAncestorByType(id: SbInstance, type: string): RuntimeWidgetMeta | undefined;
|
|
83
|
+
}
|
|
84
|
+
export default RuntimeEntitiesManager;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Name } from "../../lib/internal-details/lib/evaluator/names.js";
|
|
3
|
+
import type { IdentifierInfo, NameManager } from "../../lib/internal-details/lib/features/name-manager.js";
|
|
4
|
+
import type { SbElement, SbInstance } from "@superblocksteam/library-shared/types";
|
|
5
|
+
import type { ReactNode } from "react";
|
|
6
|
+
export type ChildFunction = React.FunctionComponent;
|
|
7
|
+
export type ChildElement = {
|
|
8
|
+
isSupportedElement: true;
|
|
9
|
+
isSbComponent: boolean;
|
|
10
|
+
value: SbInstance;
|
|
11
|
+
} | {
|
|
12
|
+
isSupportedElement: false;
|
|
13
|
+
isSbComponent: false;
|
|
14
|
+
value: ChildFunction;
|
|
15
|
+
};
|
|
16
|
+
export type RuntimeWidgetMeta = {
|
|
17
|
+
instanceId: SbInstance;
|
|
18
|
+
sourceId: SbElement;
|
|
19
|
+
rootInstanceId: SbInstance;
|
|
20
|
+
isSbComponent: boolean;
|
|
21
|
+
isInCustomComponent: boolean;
|
|
22
|
+
node?: ReactNode;
|
|
23
|
+
scopeId?: string;
|
|
24
|
+
type?: string;
|
|
25
|
+
name?: Name;
|
|
26
|
+
props?: Record<string, unknown>;
|
|
27
|
+
children?: ChildElement[];
|
|
28
|
+
parentInstanceId?: SbInstance;
|
|
29
|
+
isUnmounted?: boolean;
|
|
30
|
+
};
|
|
31
|
+
declare class RuntimeWidgetsManager {
|
|
32
|
+
readonly nameManager: NameManager;
|
|
33
|
+
private widgets;
|
|
34
|
+
private sourceIdCount;
|
|
35
|
+
private sourceToInstanceIdSample;
|
|
36
|
+
constructor(nameManager: NameManager);
|
|
37
|
+
private setWidgetMeta;
|
|
38
|
+
getAnyInstanceIdForSourceId(sourceId: SbElement): `I-${string}`;
|
|
39
|
+
processRoot(params: {
|
|
40
|
+
rootIdentifier: IdentifierInfo;
|
|
41
|
+
rootProps: Record<string, unknown>;
|
|
42
|
+
rootType: string;
|
|
43
|
+
isInCustomComponent: boolean;
|
|
44
|
+
fallbackScopeId: string;
|
|
45
|
+
}): void;
|
|
46
|
+
getMeta(id: SbInstance): RuntimeWidgetMeta | undefined;
|
|
47
|
+
getSourceIdCount(sourceId: SbElement): number;
|
|
48
|
+
isChildOf(childId: SbInstance, parentId: SbInstance): boolean;
|
|
49
|
+
getClosestAncestorByType(instanceId: SbInstance, type: string): RuntimeWidgetMeta | undefined;
|
|
50
|
+
}
|
|
51
|
+
export default RuntimeWidgetsManager;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DragAndDropManager } from "./drag-and-drop-store.js";
|
|
2
|
+
import { ResizingManager } from "./resizing-store.js";
|
|
3
|
+
import type { RootStore } from "../../lib/internal-details/lib/root-store.js";
|
|
4
|
+
import type { EditStore } from "../edit-store.js";
|
|
5
|
+
import type { SbElement, SbInstance } from "@superblocksteam/library-shared/types";
|
|
6
|
+
declare class UIStore {
|
|
7
|
+
readonly root: RootStore;
|
|
8
|
+
readonly editStore: EditStore;
|
|
9
|
+
dnd: DragAndDropManager;
|
|
10
|
+
resizing: ResizingManager;
|
|
11
|
+
private _selectedSourceIds;
|
|
12
|
+
private _selectedInstanceIds;
|
|
13
|
+
private _focusedSourceId;
|
|
14
|
+
private _focusedInstanceId;
|
|
15
|
+
private newComponentSelectPromise;
|
|
16
|
+
constructor(root: RootStore, editStore: EditStore);
|
|
17
|
+
isSourceSelected(sourceId: SbElement): boolean;
|
|
18
|
+
isInstanceSelected(instanceId: SbInstance): boolean;
|
|
19
|
+
isSourceFocused(sourceId: SbElement): boolean;
|
|
20
|
+
isInstanceFocused(instanceId: SbInstance): boolean;
|
|
21
|
+
getSelectedSourceIds(): SbElement[];
|
|
22
|
+
getSelectedInstanceIds(): SbInstance[];
|
|
23
|
+
private get focusedSourceId();
|
|
24
|
+
private get focusedInstanceId();
|
|
25
|
+
getFocusedSourceId(): SbElement | null;
|
|
26
|
+
getFocusedInstanceId(): SbInstance | null;
|
|
27
|
+
setSelectedSourceIds(sourceIds: SbElement[]): void;
|
|
28
|
+
setSelectedInstanceIds(ids: SbInstance[]): void;
|
|
29
|
+
setFocusedInstanceId(instanceId: SbInstance | null): void;
|
|
30
|
+
setFocusedSourceId(sourceId: SbElement | null): void;
|
|
31
|
+
selectWidget(instanceId: SbInstance | null): void;
|
|
32
|
+
/**
|
|
33
|
+
* This is cursed because component selection actually needs to be done by instance ids, but
|
|
34
|
+
* instance IDs are only guaranteed to be stable after the component is rendered, while source IDs
|
|
35
|
+
* are assigned by the source tracker.
|
|
36
|
+
*
|
|
37
|
+
* If _any_ other selection comes in before we select something, we will cancel this reaction
|
|
38
|
+
*/
|
|
39
|
+
selectNewComponentBySourceId(sourceId: SbElement): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export default UIStore;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SbInstance } from "@superblocksteam/library-shared/types";
|
|
3
|
+
export type RootType = "SbPage" | "SbModal" | "SbSlideout";
|
|
4
|
+
declare const InteractionLayer: ((props: {
|
|
5
|
+
rootType: RootType;
|
|
6
|
+
rootInstanceId: SbInstance;
|
|
7
|
+
rootName?: string;
|
|
8
|
+
}) => React.JSX.Element | null) & {
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default InteractionLayer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SbInstance } from "@superblocksteam/library-shared/types";
|
|
2
|
+
export declare const NotifierTooltipBody: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const InteractionRectHandles: (props: {
|
|
4
|
+
instanceId: SbInstance;
|
|
5
|
+
isDragging: boolean;
|
|
6
|
+
selectionType: "SELECTED" | "FOCUSED" | "ERROR";
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SbInstance } from "@superblocksteam/library-shared/types";
|
|
3
|
+
declare const NamePill: ((props: {
|
|
4
|
+
instanceId: SbInstance;
|
|
5
|
+
displayName: string;
|
|
6
|
+
anyIsDragging: boolean;
|
|
7
|
+
enableDragging: boolean;
|
|
8
|
+
type: "SELECTED" | "FOCUSED" | "ERROR";
|
|
9
|
+
isVisible?: boolean;
|
|
10
|
+
}) => React.JSX.Element) & {
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default NamePill;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { RootType } from "./interaction-layer.jsx";
|
|
3
|
+
import type { IdentifierInfo } from "../lib/internal-details/lib/features/name-manager.js";
|
|
4
|
+
import type { SbElement, SbInstance } from "@superblocksteam/library-shared/types";
|
|
5
|
+
type SelectionInfo = {
|
|
6
|
+
sourceId: SbElement;
|
|
7
|
+
instanceId: SbInstance;
|
|
8
|
+
displayName: string;
|
|
9
|
+
selectionType: "SELECTED" | "FOCUSED";
|
|
10
|
+
type: string | undefined;
|
|
11
|
+
isVisible?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const isWidgetInCurrentLayer: ({ instanceId, rootType, rootInstanceId, }: {
|
|
14
|
+
instanceId: SbInstance;
|
|
15
|
+
rootType: RootType;
|
|
16
|
+
rootInstanceId: SbInstance;
|
|
17
|
+
}) => boolean;
|
|
18
|
+
export declare const useWidgetErrors: (params: {
|
|
19
|
+
widgetScopesToNamesToIds: Record<string, Record<string, Record<SbInstance, IdentifierInfo>>>;
|
|
20
|
+
rootType: RootType;
|
|
21
|
+
rootInstanceId: SbInstance;
|
|
22
|
+
scopeId: string;
|
|
23
|
+
}) => Record<SbInstance, {
|
|
24
|
+
name: string;
|
|
25
|
+
error: string;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const useSelectionElements: (params: {
|
|
28
|
+
focusedSourceId: SbElement | null;
|
|
29
|
+
selectedSourceIds: SbElement[];
|
|
30
|
+
focusedInstanceId: SbInstance | null;
|
|
31
|
+
selectedInstanceIds: SbInstance[];
|
|
32
|
+
rootType: RootType;
|
|
33
|
+
rootId: SbInstance;
|
|
34
|
+
}) => SelectionInfo[];
|
|
35
|
+
export declare const InteractionRect: (props: {
|
|
36
|
+
displayName: string;
|
|
37
|
+
isDragging: boolean;
|
|
38
|
+
instanceId: SbInstance;
|
|
39
|
+
selectionType: "SELECTED" | "FOCUSED" | "ERROR";
|
|
40
|
+
hideRectBorder?: boolean;
|
|
41
|
+
isVisible?: boolean;
|
|
42
|
+
type?: string;
|
|
43
|
+
}) => React.JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IObjectDidChange, IArrayDidChange, IMapDidChange } from "mobx";
|
|
2
|
+
export type IDisposer = () => void;
|
|
3
|
+
type IChange = IObjectDidChange | IArrayDidChange | IMapDidChange;
|
|
4
|
+
export type ObserveListener<T> = (change: IChange, path: string, root: T) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Given an object, deeply observes the given object.
|
|
7
|
+
* It is like `observe` from mobx, but applied recursively, including all future children.
|
|
8
|
+
*
|
|
9
|
+
* Note that the given object cannot ever contain cycles and should be a tree.
|
|
10
|
+
*
|
|
11
|
+
* As benefit: path and root will be provided in the callback, so the signature of the listener is
|
|
12
|
+
* (change, path, root) => void
|
|
13
|
+
*
|
|
14
|
+
* The returned disposer can be invoked to clean up the listener
|
|
15
|
+
*
|
|
16
|
+
* deepObserve cannot be used on computed values.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const disposer = deepObserve(target, (change, path) => {
|
|
20
|
+
* console.dir(change)
|
|
21
|
+
* })
|
|
22
|
+
*/
|
|
23
|
+
export declare function deepObserve<T = any>(target: T, listener: ObserveListener<T>): IDisposer;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { KeyToState } from "@superblocksteam/library-shared/types";
|
|
2
|
+
export interface MobXEditorSyncOptions<SID extends keyof KeyToState = keyof KeyToState, OUTPUT extends KeyToState[SID] = KeyToState[SID], STORE = OUTPUT> {
|
|
3
|
+
storeId: SID & string;
|
|
4
|
+
store: STORE;
|
|
5
|
+
/**
|
|
6
|
+
* A function that takes the store and returns a view/projection of the store.
|
|
7
|
+
* This is useful for syncing only a subset of the store in a different shape.
|
|
8
|
+
*/
|
|
9
|
+
projection?: (store: STORE) => OUTPUT;
|
|
10
|
+
/**
|
|
11
|
+
* When provided, only patches under these keys are forwarded.
|
|
12
|
+
* Other changes are dropped.
|
|
13
|
+
*/
|
|
14
|
+
keys?: Record<keyof OUTPUT, true>;
|
|
15
|
+
/**
|
|
16
|
+
* Debounce time in milliseconds.
|
|
17
|
+
*/
|
|
18
|
+
debounce?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Syncs a mobx store to the editor automatically through postmessage
|
|
22
|
+
*/
|
|
23
|
+
export declare function startEditorSync<SID extends keyof KeyToState = keyof KeyToState, OUTPUT extends KeyToState[SID] = KeyToState[SID], STORE = any>(options: MobXEditorSyncOptions<SID, OUTPUT, STORE>): () => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Name } from "../lib/internal-details/lib/evaluator/names.js";
|
|
2
|
+
/**
|
|
3
|
+
* Gets the actual value from a PropertyInfo object.
|
|
4
|
+
* This will parse the value based on the type of property.
|
|
5
|
+
* @param property - The property to get the value from.
|
|
6
|
+
* @returns The parsed value of the property.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPropertyValue({ entityKey, property, name, scopeId, }: {
|
|
9
|
+
property: unknown;
|
|
10
|
+
entityKey?: string;
|
|
11
|
+
name?: Name;
|
|
12
|
+
scopeId?: string;
|
|
13
|
+
}): unknown;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SbElement } from "@superblocksteam/library-shared/types";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
interface RightClickMenuProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
componentName: string;
|
|
7
|
+
sourceId: SbElement;
|
|
8
|
+
scopeName: string;
|
|
9
|
+
}
|
|
10
|
+
declare const RightClickMenuWrapper: React.FC<RightClickMenuProps & {
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export default RightClickMenuWrapper;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { IdentifierInfo } from "../lib/internal-details/lib/features/name-manager.js";
|
|
3
|
+
export declare function EditorRoot(props: {
|
|
4
|
+
type: string;
|
|
5
|
+
identifier: IdentifierInfo;
|
|
6
|
+
children: any;
|
|
7
|
+
widgetProps: Record<string, unknown>;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChildFunction } from "./features/runtime-widgets-manager.js";
|
|
2
|
+
import type { SbInstance } from "@superblocksteam/library-shared/types";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Attempts to merge the children of a component with the children that should be rendered
|
|
6
|
+
* based on the current state from our drag-and-drop editor.
|
|
7
|
+
*
|
|
8
|
+
* @returns {ReactNode[]} - An array of merged and sorted React nodes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useRuntimeChildren(props: {
|
|
11
|
+
instanceId: SbInstance;
|
|
12
|
+
isEditing: boolean;
|
|
13
|
+
children?: ReactNode[] | ChildFunction;
|
|
14
|
+
}): ReactNode[] | ChildFunction | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { EditOperationType, EditOperations, ReparentRequest, CreateRequest, SetPropertyRequest, SetPropertiesRequest, BatchUpdateRequest, ApiUpdateRequest, AddEntityRequest, UpdateEntityRequest, UpdateThemeRequest, DeleteEntityRequest } from "@superblocksteam/library-shared/types";
|
|
2
|
+
type CamelCase<S extends string> = S extends `${infer Head}-${infer Tail}` ? `${Head}${Capitalize<CamelCase<Tail>>}` : S extends `${infer Head}:${infer Tail}` ? `${Head}${Capitalize<CamelCase<Tail>>}` : S;
|
|
3
|
+
type IOperationAPI = {
|
|
4
|
+
[K in EditOperationType as CamelCase<K>]: (payload: Parameters<EditOperations[K]>[0]) => Promise<ReturnType<EditOperations[K]> | undefined>;
|
|
5
|
+
};
|
|
6
|
+
declare class OperationAPI implements IOperationAPI {
|
|
7
|
+
private readonly serverUrl;
|
|
8
|
+
private socket;
|
|
9
|
+
constructor(serverUrl: string);
|
|
10
|
+
connect(peerId: string, userId?: string): Promise<void>;
|
|
11
|
+
editorMoveComponent: (payload: ReparentRequest) => Promise<void | undefined>;
|
|
12
|
+
editorCreateComponent: (payload: CreateRequest) => Promise<`SB-${string}` | undefined>;
|
|
13
|
+
editorSetProperty: (payload: SetPropertyRequest) => Promise<void | undefined>;
|
|
14
|
+
editorSetProperties: (payload: SetPropertiesRequest) => Promise<any>;
|
|
15
|
+
editorBatchUpdate: (payload: BatchUpdateRequest) => Promise<unknown[] | undefined>;
|
|
16
|
+
apiUpdate: (payload: ApiUpdateRequest) => Promise<import("@superblocksteam/library-shared/types").ApiUpdateResponse | undefined>;
|
|
17
|
+
editorAddEntity: (payload: AddEntityRequest) => Promise<void | undefined>;
|
|
18
|
+
editorUpdateEntity: (payload: UpdateEntityRequest) => Promise<void | undefined>;
|
|
19
|
+
editorDeleteEntity: (payload: DeleteEntityRequest) => Promise<void | undefined>;
|
|
20
|
+
editorUpdateTheme: (payload: UpdateThemeRequest) => Promise<void | undefined>;
|
|
21
|
+
ensureFilesSynced: () => Promise<string | undefined>;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: OperationAPI;
|
|
24
|
+
export default _default;
|