@vamos-ui/react 0.0.0-stage → 0.2.0
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 +21 -0
- package/README.md +27 -2
- package/dist/blocks/block-heading.d.ts +29 -0
- package/dist/blocks/block-heading.js +39 -0
- package/dist/blocks/block-image.d.ts +52 -0
- package/dist/blocks/block-image.js +48 -0
- package/dist/blocks/block-link.d.ts +30 -0
- package/dist/blocks/block-link.js +36 -0
- package/dist/blocks/create-blocks.d.ts +54 -0
- package/dist/blocks/create-blocks.js +52 -0
- package/dist/blocks/index.d.ts +55 -0
- package/dist/blocks/index.js +59 -0
- package/dist/blocks/json-ld.d.ts +18 -0
- package/dist/blocks/json-ld.js +44 -0
- package/dist/blocks/labels.d.ts +20 -0
- package/dist/blocks/labels.js +43 -0
- package/dist/blocks/rich-text.d.ts +36 -0
- package/dist/blocks/rich-text.js +106 -0
- package/dist/blocks/schema/define-block.d.ts +151 -0
- package/dist/blocks/schema/define-block.js +120 -0
- package/dist/blocks/schema/emphasis.d.ts +17 -0
- package/dist/blocks/schema/emphasis.js +69 -0
- package/dist/blocks/schema/fields.d.ts +497 -0
- package/dist/blocks/schema/fields.js +240 -0
- package/dist/blocks/schema/icons.d.ts +2 -0
- package/dist/blocks/schema/icons.js +26 -0
- package/dist/blocks/schema/index.d.ts +18 -0
- package/dist/blocks/schema/index.js +21 -0
- package/dist/blocks/schema/lint-types.d.ts +16 -0
- package/dist/blocks/schema/lint-types.js +2 -0
- package/dist/blocks/schema/lint.d.ts +32 -0
- package/dist/blocks/schema/lint.js +164 -0
- package/dist/blocks/schema/localize.d.ts +20 -0
- package/dist/blocks/schema/localize.js +29 -0
- package/dist/blocks/schema/localized.d.ts +25 -0
- package/dist/blocks/schema/localized.js +53 -0
- package/dist/blocks/schema/migrate.d.ts +24 -0
- package/dist/blocks/schema/migrate.js +75 -0
- package/dist/blocks/schema/nodes.d.ts +196 -0
- package/dist/blocks/schema/nodes.js +78 -0
- package/dist/blocks/schema/rich-doc-schema.d.ts +32 -0
- package/dist/blocks/schema/rich-doc-schema.js +66 -0
- package/dist/blocks/schema/rich-doc.d.ts +90 -0
- package/dist/blocks/schema/rich-doc.js +62 -0
- package/dist/blocks/schema/safety.d.ts +20 -0
- package/dist/blocks/schema/safety.js +49 -0
- package/dist/blocks/schema/types.d.ts +172 -0
- package/dist/blocks/schema/types.js +3 -0
- package/dist/blocks/schema/validate.d.ts +17 -0
- package/dist/blocks/schema/validate.js +32 -0
- package/dist/blocks/schema/walk.d.ts +22 -0
- package/dist/blocks/schema/walk.js +60 -0
- package/dist/blocks/section-header.d.ts +38 -0
- package/dist/blocks/section-header.js +22 -0
- package/dist/blocks/section.d.ts +59 -0
- package/dist/blocks/section.js +66 -0
- package/dist/blocks/site/_kit-1.d.ts +100 -0
- package/dist/blocks/site/_kit-1.js +135 -0
- package/dist/blocks/site/_site-icon-1.d.ts +6 -0
- package/dist/blocks/site/_site-icon-1.js +15 -0
- package/dist/blocks/site/announcement-bar.d.ts +42 -0
- package/dist/blocks/site/announcement-bar.js +38 -0
- package/dist/blocks/site/announcement-dismiss.d.ts +18 -0
- package/dist/blocks/site/announcement-dismiss.js +28 -0
- package/dist/blocks/site/article-layout.d.ts +65 -0
- package/dist/blocks/site/article-layout.js +88 -0
- package/dist/blocks/site/blog-list.d.ts +79 -0
- package/dist/blocks/site/blog-list.js +78 -0
- package/dist/blocks/site/comparison-table.d.ts +54 -0
- package/dist/blocks/site/comparison-table.js +38 -0
- package/dist/blocks/site/consent-banner.d.ts +52 -0
- package/dist/blocks/site/consent-banner.js +33 -0
- package/dist/blocks/site/contact-dock.d.ts +52 -0
- package/dist/blocks/site/contact-dock.js +55 -0
- package/dist/blocks/site/contact-form.d.ts +60 -0
- package/dist/blocks/site/contact-form.js +45 -0
- package/dist/blocks/site/cta-booking.d.ts +43 -0
- package/dist/blocks/site/cta-booking.js +69 -0
- package/dist/blocks/site/cta.d.ts +74 -0
- package/dist/blocks/site/cta.js +112 -0
- package/dist/blocks/site/embed-facade.d.ts +20 -0
- package/dist/blocks/site/embed-facade.js +21 -0
- package/dist/blocks/site/faq.d.ts +48 -0
- package/dist/blocks/site/faq.js +51 -0
- package/dist/blocks/site/feature-grid.d.ts +46 -0
- package/dist/blocks/site/feature-grid.js +49 -0
- package/dist/blocks/site/feature-tabs.d.ts +22 -0
- package/dist/blocks/site/feature-tabs.js +11 -0
- package/dist/blocks/site/footer.d.ts +68 -0
- package/dist/blocks/site/footer.js +61 -0
- package/dist/blocks/site/gallery-section.d.ts +42 -0
- package/dist/blocks/site/gallery-section.js +47 -0
- package/dist/blocks/site/hero-video.d.ts +15 -0
- package/dist/blocks/site/hero-video.js +31 -0
- package/dist/blocks/site/hero.d.ts +64 -0
- package/dist/blocks/site/hero.js +67 -0
- package/dist/blocks/site/logo-strip.d.ts +42 -0
- package/dist/blocks/site/logo-strip.js +26 -0
- package/dist/blocks/site/map-hours.d.ts +83 -0
- package/dist/blocks/site/map-hours.js +125 -0
- package/dist/blocks/site/media-text.d.ts +45 -0
- package/dist/blocks/site/media-text.js +55 -0
- package/dist/blocks/site/menu-list.d.ts +74 -0
- package/dist/blocks/site/menu-list.js +84 -0
- package/dist/blocks/site/navbar-submenu.d.ts +18 -0
- package/dist/blocks/site/navbar-submenu.js +51 -0
- package/dist/blocks/site/navbar.d.ts +67 -0
- package/dist/blocks/site/navbar.js +64 -0
- package/dist/blocks/site/not-found.d.ts +40 -0
- package/dist/blocks/site/not-found.js +38 -0
- package/dist/blocks/site/page-intro.d.ts +46 -0
- package/dist/blocks/site/page-intro.js +44 -0
- package/dist/blocks/site/pricing-table.d.ts +67 -0
- package/dist/blocks/site/pricing-table.js +82 -0
- package/dist/blocks/site/process.d.ts +36 -0
- package/dist/blocks/site/process.js +41 -0
- package/dist/blocks/site/registry-1.d.ts +720 -0
- package/dist/blocks/site/registry-1.js +783 -0
- package/dist/blocks/site/registry-2.d.ts +914 -0
- package/dist/blocks/site/registry-2.js +563 -0
- package/dist/blocks/site/rich-text-section.d.ts +34 -0
- package/dist/blocks/site/rich-text-section.js +32 -0
- package/dist/blocks/site/shared/brand-icons.d.ts +21 -0
- package/dist/blocks/site/shared/brand-icons.js +56 -0
- package/dist/blocks/site/shared/consent-gate.d.ts +41 -0
- package/dist/blocks/site/shared/consent-gate.js +43 -0
- package/dist/blocks/site/shared/consent-island.d.ts +38 -0
- package/dist/blocks/site/shared/consent-island.js +63 -0
- package/dist/blocks/site/shared/consent.d.ts +49 -0
- package/dist/blocks/site/shared/consent.js +130 -0
- package/dist/blocks/site/shared/contact-form-island.d.ts +41 -0
- package/dist/blocks/site/shared/contact-form-island.js +100 -0
- package/dist/blocks/site/shared/copy-link.d.ts +10 -0
- package/dist/blocks/site/shared/copy-link.js +25 -0
- package/dist/blocks/site/shared/dock-avoid.d.ts +15 -0
- package/dist/blocks/site/shared/dock-avoid.js +107 -0
- package/dist/blocks/site/shared/dock-hours.d.ts +13 -0
- package/dist/blocks/site/shared/dock-hours.js +25 -0
- package/dist/blocks/site/shared/gallery-lightbox.d.ts +12 -0
- package/dist/blocks/site/shared/gallery-lightbox.js +10 -0
- package/dist/blocks/site/shared/island-keys.d.ts +10 -0
- package/dist/blocks/site/shared/island-keys.js +44 -0
- package/dist/blocks/site/shared/kit-2.d.ts +55 -0
- package/dist/blocks/site/shared/kit-2.js +84 -0
- package/dist/blocks/site/shared/labels-2.d.ts +209 -0
- package/dist/blocks/site/shared/labels-2.js +427 -0
- package/dist/blocks/site/shared/open-now.d.ts +22 -0
- package/dist/blocks/site/shared/open-now.js +27 -0
- package/dist/blocks/site/shared/opening-hours.d.ts +117 -0
- package/dist/blocks/site/shared/opening-hours.js +245 -0
- package/dist/blocks/site/shared/site-accent.d.ts +48 -0
- package/dist/blocks/site/shared/site-accent.js +249 -0
- package/dist/blocks/site/shared/site-form.d.ts +79 -0
- package/dist/blocks/site/shared/site-form.js +111 -0
- package/dist/blocks/site/shared/site-routing.d.ts +54 -0
- package/dist/blocks/site/shared/site-routing.js +86 -0
- package/dist/blocks/site/shared/testimonials-carousel.d.ts +17 -0
- package/dist/blocks/site/shared/testimonials-carousel.js +64 -0
- package/dist/blocks/site/site-shell.d.ts +97 -0
- package/dist/blocks/site/site-shell.js +227 -0
- package/dist/blocks/site/stats-band.d.ts +40 -0
- package/dist/blocks/site/stats-band.js +41 -0
- package/dist/blocks/site/team.d.ts +44 -0
- package/dist/blocks/site/team.js +48 -0
- package/dist/blocks/site/testimonials.d.ts +68 -0
- package/dist/blocks/site/testimonials.js +65 -0
- package/dist/blocks/types.d.ts +63 -0
- package/dist/blocks/types.js +2 -0
- package/dist/business/approval-flow.d.ts +152 -0
- package/dist/business/approval-flow.js +221 -0
- package/dist/business/export-core.d.ts +55 -0
- package/dist/business/export-core.js +101 -0
- package/dist/business/export.d.ts +148 -0
- package/dist/business/export.js +264 -0
- package/dist/business/import-core.d.ts +104 -0
- package/dist/business/import-core.js +281 -0
- package/dist/business/import-wizard.d.ts +186 -0
- package/dist/business/import-wizard.js +401 -0
- package/dist/business/index.d.ts +11 -0
- package/dist/business/index.js +20 -0
- package/dist/business/line-items-core.d.ts +129 -0
- package/dist/business/line-items-core.js +183 -0
- package/dist/business/line-items.d.ts +119 -0
- package/dist/business/line-items.js +299 -0
- package/dist/business/multi-step-form.d.ts +131 -0
- package/dist/business/multi-step-form.js +337 -0
- package/dist/business/permission-core.d.ts +59 -0
- package/dist/business/permission-core.js +99 -0
- package/dist/business/permission-matrix.d.ts +158 -0
- package/dist/business/permission-matrix.js +341 -0
- package/dist/business/setup-checklist.d.ts +80 -0
- package/dist/business/setup-checklist.js +92 -0
- package/dist/charts/area-chart.d.ts +35 -0
- package/dist/charts/area-chart.js +33 -0
- package/dist/charts/bar-chart.d.ts +27 -0
- package/dist/charts/bar-chart.js +42 -0
- package/dist/charts/bar-list.d.ts +47 -0
- package/dist/charts/bar-list.js +60 -0
- package/dist/charts/chart-shell.d.ts +173 -0
- package/dist/charts/chart-shell.js +205 -0
- package/dist/charts/chart.d.ts +73 -0
- package/dist/charts/chart.js +106 -0
- package/dist/charts/combo-chart.d.ts +29 -0
- package/dist/charts/combo-chart.js +47 -0
- package/dist/charts/donut-chart.d.ts +33 -0
- package/dist/charts/donut-chart.js +113 -0
- package/dist/charts/funnel.d.ts +51 -0
- package/dist/charts/funnel.js +69 -0
- package/dist/charts/gauge.d.ts +62 -0
- package/dist/charts/gauge.js +104 -0
- package/dist/charts/heatmap.d.ts +81 -0
- package/dist/charts/heatmap.js +338 -0
- package/dist/charts/index.d.ts +12 -0
- package/dist/charts/index.js +14 -0
- package/dist/charts/line-chart.d.ts +21 -0
- package/dist/charts/line-chart.js +36 -0
- package/dist/charts/test-utils.d.ts +2 -0
- package/dist/charts/test-utils.js +38 -0
- package/dist/charts/utils.d.ts +130 -0
- package/dist/charts/utils.js +262 -0
- package/dist/components/accordion.d.ts +47 -0
- package/dist/components/accordion.js +70 -0
- package/dist/components/activity-timeline.d.ts +149 -0
- package/dist/components/activity-timeline.js +122 -0
- package/dist/components/address-field.d.ts +116 -0
- package/dist/components/address-field.js +219 -0
- package/dist/components/alert-dialog.d.ts +99 -0
- package/dist/components/alert-dialog.js +192 -0
- package/dist/components/alert.d.ts +42 -0
- package/dist/components/alert.js +82 -0
- package/dist/components/app-shell.d.ts +159 -0
- package/dist/components/app-shell.js +289 -0
- package/dist/components/attachment-list.d.ts +96 -0
- package/dist/components/attachment-list.js +196 -0
- package/dist/components/audit-log.d.ts +150 -0
- package/dist/components/audit-log.js +205 -0
- package/dist/components/avatar.d.ts +87 -0
- package/dist/components/avatar.js +126 -0
- package/dist/components/badge.d.ts +41 -0
- package/dist/components/badge.js +68 -0
- package/dist/components/breadcrumb.d.ts +78 -0
- package/dist/components/breadcrumb.js +106 -0
- package/dist/components/button-group.d.ts +52 -0
- package/dist/components/button-group.js +77 -0
- package/dist/components/button.d.ts +58 -0
- package/dist/components/button.js +107 -0
- package/dist/components/calendar.d.ts +240 -0
- package/dist/components/calendar.js +483 -0
- package/dist/components/card.d.ts +66 -0
- package/dist/components/card.js +76 -0
- package/dist/components/carousel.d.ts +170 -0
- package/dist/components/carousel.js +348 -0
- package/dist/components/checkbox.d.ts +78 -0
- package/dist/components/checkbox.js +138 -0
- package/dist/components/color-picker.d.ts +112 -0
- package/dist/components/color-picker.js +235 -0
- package/dist/components/combobox.d.ts +136 -0
- package/dist/components/combobox.js +294 -0
- package/dist/components/command.d.ts +275 -0
- package/dist/components/command.js +493 -0
- package/dist/components/comment-thread.d.ts +252 -0
- package/dist/components/comment-thread.js +449 -0
- package/dist/components/context-menu.d.ts +77 -0
- package/dist/components/context-menu.js +82 -0
- package/dist/components/currency-input.d.ts +43 -0
- package/dist/components/currency-input.js +85 -0
- package/dist/components/date-picker.d.ts +141 -0
- package/dist/components/date-picker.js +241 -0
- package/dist/components/date-range-picker.d.ts +91 -0
- package/dist/components/date-range-picker.js +251 -0
- package/dist/components/description-list.d.ts +92 -0
- package/dist/components/description-list.js +42 -0
- package/dist/components/dialog.d.ts +139 -0
- package/dist/components/dialog.js +185 -0
- package/dist/components/dropdown-menu.d.ts +100 -0
- package/dist/components/dropdown-menu.js +102 -0
- package/dist/components/editor-layout.d.ts +166 -0
- package/dist/components/editor-layout.js +237 -0
- package/dist/components/empty-state.d.ts +49 -0
- package/dist/components/empty-state.js +68 -0
- package/dist/components/entity-card.d.ts +83 -0
- package/dist/components/entity-card.js +92 -0
- package/dist/components/file-upload.d.ts +256 -0
- package/dist/components/file-upload.js +490 -0
- package/dist/components/formatted-input.d.ts +177 -0
- package/dist/components/formatted-input.js +399 -0
- package/dist/components/hierarchy-chart.d.ts +190 -0
- package/dist/components/hierarchy-chart.js +890 -0
- package/dist/components/hover-card.d.ts +21 -0
- package/dist/components/hover-card.js +32 -0
- package/dist/components/iban-input.d.ts +38 -0
- package/dist/components/iban-input.js +112 -0
- package/dist/components/id-input.d.ts +65 -0
- package/dist/components/id-input.js +130 -0
- package/dist/components/image.d.ts +130 -0
- package/dist/components/image.js +168 -0
- package/dist/components/input-otp.d.ts +62 -0
- package/dist/components/input-otp.js +73 -0
- package/dist/components/input.d.ts +141 -0
- package/dist/components/input.js +187 -0
- package/dist/components/item.d.ts +96 -0
- package/dist/components/item.js +113 -0
- package/dist/components/kbd.d.ts +64 -0
- package/dist/components/kbd.js +119 -0
- package/dist/components/list-layout.d.ts +144 -0
- package/dist/components/list-layout.js +210 -0
- package/dist/components/native-select.d.ts +33 -0
- package/dist/components/native-select.js +48 -0
- package/dist/components/navigation-menu.d.ts +127 -0
- package/dist/components/navigation-menu.js +129 -0
- package/dist/components/notification-center.d.ts +164 -0
- package/dist/components/notification-center.js +399 -0
- package/dist/components/page-header.d.ts +60 -0
- package/dist/components/page-header.js +60 -0
- package/dist/components/pagination.d.ts +121 -0
- package/dist/components/pagination.js +174 -0
- package/dist/components/phone-input.d.ts +49 -0
- package/dist/components/phone-input.js +266 -0
- package/dist/components/popover.d.ts +38 -0
- package/dist/components/popover.js +69 -0
- package/dist/components/progress.d.ts +79 -0
- package/dist/components/progress.js +97 -0
- package/dist/components/radio-group.d.ts +43 -0
- package/dist/components/radio-group.js +81 -0
- package/dist/components/record-detail-layout.d.ts +167 -0
- package/dist/components/record-detail-layout.js +233 -0
- package/dist/components/record-picker.d.ts +199 -0
- package/dist/components/record-picker.js +650 -0
- package/dist/components/resizable.d.ts +50 -0
- package/dist/components/resizable.js +88 -0
- package/dist/components/scroll-area.d.ts +40 -0
- package/dist/components/scroll-area.js +56 -0
- package/dist/components/select.d.ts +126 -0
- package/dist/components/select.js +137 -0
- package/dist/components/separator.d.ts +31 -0
- package/dist/components/separator.js +41 -0
- package/dist/components/settings-layout.d.ts +134 -0
- package/dist/components/settings-layout.js +180 -0
- package/dist/components/sheet.d.ts +103 -0
- package/dist/components/sheet.js +165 -0
- package/dist/components/sidebar.d.ts +171 -0
- package/dist/components/sidebar.js +421 -0
- package/dist/components/signature-pad.d.ts +85 -0
- package/dist/components/signature-pad.js +283 -0
- package/dist/components/skeleton.d.ts +64 -0
- package/dist/components/skeleton.js +53 -0
- package/dist/components/slider.d.ts +57 -0
- package/dist/components/slider.js +133 -0
- package/dist/components/slug-input.d.ts +69 -0
- package/dist/components/slug-input.js +201 -0
- package/dist/components/sparkline.d.ts +54 -0
- package/dist/components/sparkline.js +122 -0
- package/dist/components/spinner.d.ts +34 -0
- package/dist/components/spinner.js +34 -0
- package/dist/components/stat.d.ts +135 -0
- package/dist/components/stat.js +130 -0
- package/dist/components/status-picker.d.ts +107 -0
- package/dist/components/status-picker.js +175 -0
- package/dist/components/stepper.d.ts +86 -0
- package/dist/components/stepper.js +103 -0
- package/dist/components/switch.d.ts +34 -0
- package/dist/components/switch.js +70 -0
- package/dist/components/table.d.ts +101 -0
- package/dist/components/table.js +72 -0
- package/dist/components/tabs.d.ts +103 -0
- package/dist/components/tabs.js +173 -0
- package/dist/components/tag-input.d.ts +77 -0
- package/dist/components/tag-input.js +305 -0
- package/dist/components/task-list.d.ts +89 -0
- package/dist/components/task-list.js +238 -0
- package/dist/components/time-picker.d.ts +119 -0
- package/dist/components/time-picker.js +399 -0
- package/dist/components/toast.d.ts +87 -0
- package/dist/components/toast.js +142 -0
- package/dist/components/toggle.d.ts +77 -0
- package/dist/components/toggle.js +109 -0
- package/dist/components/tooltip.d.ts +69 -0
- package/dist/components/tooltip.js +105 -0
- package/dist/components/top-bar.d.ts +87 -0
- package/dist/components/top-bar.js +99 -0
- package/dist/components/tree-select.d.ts +89 -0
- package/dist/components/tree-select.js +243 -0
- package/dist/components/tree-view.d.ts +109 -0
- package/dist/components/tree-view.js +170 -0
- package/dist/components/typography.d.ts +107 -0
- package/dist/components/typography.js +128 -0
- package/dist/components/user-picker.d.ts +89 -0
- package/dist/components/user-picker.js +162 -0
- package/dist/components/version-history.d.ts +191 -0
- package/dist/components/version-history.js +431 -0
- package/dist/data-table/csv.d.ts +27 -0
- package/dist/data-table/csv.js +68 -0
- package/dist/data-table/data-table.d.ts +423 -0
- package/dist/data-table/data-table.js +1259 -0
- package/dist/data-table/filter-bar.d.ts +146 -0
- package/dist/data-table/filter-bar.js +569 -0
- package/dist/data-table/filter-fns.d.ts +65 -0
- package/dist/data-table/filter-fns.js +382 -0
- package/dist/data-table/index.d.ts +8 -0
- package/dist/data-table/index.js +9 -0
- package/dist/data-table/saved-views.d.ts +100 -0
- package/dist/data-table/saved-views.js +251 -0
- package/dist/data-table/types.d.ts +168 -0
- package/dist/data-table/types.js +87 -0
- package/dist/data-table/url-state.d.ts +94 -0
- package/dist/data-table/url-state.js +303 -0
- package/dist/data-table/view-state.d.ts +16 -0
- package/dist/data-table/view-state.js +81 -0
- package/dist/editor/_test-setup.d.ts +1 -0
- package/dist/editor/_test-setup.js +33 -0
- package/dist/editor/block-editor.d.ts +137 -0
- package/dist/editor/block-editor.js +280 -0
- package/dist/editor/commands.d.ts +31 -0
- package/dist/editor/commands.js +150 -0
- package/dist/editor/context.d.ts +108 -0
- package/dist/editor/context.js +30 -0
- package/dist/editor/convert.d.ts +66 -0
- package/dist/editor/convert.js +567 -0
- package/dist/editor/drag-handle.d.ts +10 -0
- package/dist/editor/drag-handle.js +69 -0
- package/dist/editor/extensions.d.ts +34 -0
- package/dist/editor/extensions.js +239 -0
- package/dist/editor/index.d.ts +14 -0
- package/dist/editor/index.js +17 -0
- package/dist/editor/inserter.d.ts +12 -0
- package/dist/editor/inserter.js +88 -0
- package/dist/editor/inspector.d.ts +17 -0
- package/dist/editor/inspector.js +65 -0
- package/dist/editor/items.d.ts +62 -0
- package/dist/editor/items.js +195 -0
- package/dist/editor/labels.d.ts +119 -0
- package/dist/editor/labels.js +130 -0
- package/dist/editor/markdown.d.ts +14 -0
- package/dist/editor/markdown.js +209 -0
- package/dist/editor/menus.d.ts +20 -0
- package/dist/editor/menus.js +236 -0
- package/dist/editor/nodes.d.ts +14 -0
- package/dist/editor/nodes.js +201 -0
- package/dist/editor/outline.d.ts +11 -0
- package/dist/editor/outline.js +52 -0
- package/dist/editor/schema-form.d.ts +64 -0
- package/dist/editor/schema-form.js +290 -0
- package/dist/editor/slash-menu.d.ts +15 -0
- package/dist/editor/slash-menu.js +119 -0
- package/dist/fonts/catalog.d.ts +53 -0
- package/dist/fonts/catalog.js +121 -0
- package/dist/fonts/font-picker.d.ts +70 -0
- package/dist/fonts/font-picker.js +225 -0
- package/dist/fonts/index.d.ts +6 -0
- package/dist/fonts/index.js +7 -0
- package/dist/fonts/loader.d.ts +66 -0
- package/dist/fonts/loader.js +161 -0
- package/dist/fonts/pairing-picker.d.ts +31 -0
- package/dist/fonts/pairing-picker.js +81 -0
- package/dist/fonts/pairings.d.ts +84 -0
- package/dist/fonts/pairings.js +149 -0
- package/dist/fonts/provider.d.ts +34 -0
- package/dist/fonts/provider.js +51 -0
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.js +1 -0
- package/dist/format/core.d.ts +149 -0
- package/dist/format/core.js +357 -0
- package/dist/format/index.d.ts +4 -0
- package/dist/format/index.js +5 -0
- package/dist/format/use-format.d.ts +1 -0
- package/dist/format/use-format.js +3 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +87 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.js +16 -0
- package/dist/lib/color.d.ts +64 -0
- package/dist/lib/color.js +177 -0
- package/dist/lib/compose-refs.d.ts +24 -0
- package/dist/lib/compose-refs.js +45 -0
- package/dist/lib/data-islands.d.ts +194 -0
- package/dist/lib/data-islands.js +368 -0
- package/dist/lib/date.d.ts +129 -0
- package/dist/lib/date.js +386 -0
- package/dist/lib/field-context.d.ts +64 -0
- package/dist/lib/field-context.js +62 -0
- package/dist/lib/floating-arrow.d.ts +18 -0
- package/dist/lib/floating-arrow.js +15 -0
- package/dist/lib/islands.d.ts +38 -0
- package/dist/lib/islands.js +40 -0
- package/dist/lib/labels.d.ts +51 -0
- package/dist/lib/labels.js +56 -0
- package/dist/lib/layer.d.ts +36 -0
- package/dist/lib/layer.js +42 -0
- package/dist/lib/locale.d.ts +85 -0
- package/dist/lib/locale.js +105 -0
- package/dist/lib/menu.d.ts +58 -0
- package/dist/lib/menu.js +99 -0
- package/dist/lib/message-format.d.ts +20 -0
- package/dist/lib/message-format.js +116 -0
- package/dist/lib/nav.d.ts +132 -0
- package/dist/lib/nav.js +178 -0
- package/dist/lib/provider.d.ts +100 -0
- package/dist/lib/provider.js +105 -0
- package/dist/lib/public.d.ts +22 -0
- package/dist/lib/public.js +33 -0
- package/dist/lib/sr-name.d.ts +18 -0
- package/dist/lib/sr-name.js +17 -0
- package/dist/lib/text.d.ts +100 -0
- package/dist/lib/text.js +233 -0
- package/dist/lib/theme-scope.d.ts +58 -0
- package/dist/lib/theme-scope.js +59 -0
- package/dist/lib/use-async-list.d.ts +60 -0
- package/dist/lib/use-async-list.js +119 -0
- package/dist/lib/use-container-width.d.ts +19 -0
- package/dist/lib/use-container-width.js +39 -0
- package/dist/lib/use-controllable-state.d.ts +33 -0
- package/dist/lib/use-controllable-state.js +56 -0
- package/dist/lib/use-edge-fade.d.ts +13 -0
- package/dist/lib/use-edge-fade.js +43 -0
- package/dist/lib/use-formatted-input.d.ts +69 -0
- package/dist/lib/use-formatted-input.js +152 -0
- package/dist/lib/use-hotkeys.d.ts +80 -0
- package/dist/lib/use-hotkeys.js +221 -0
- package/dist/lib/use-hover-intent.d.ts +44 -0
- package/dist/lib/use-hover-intent.js +119 -0
- package/dist/lib/use-media-query.d.ts +21 -0
- package/dist/lib/use-media-query.js +28 -0
- package/dist/lib/use-reduced-motion.d.ts +8 -0
- package/dist/lib/use-reduced-motion.js +13 -0
- package/dist/lib/use-tree.d.ts +153 -0
- package/dist/lib/use-tree.js +534 -0
- package/dist/lib/value-format.d.ts +25 -0
- package/dist/lib/value-format.js +56 -0
- package/dist/lib/variants.d.ts +131 -0
- package/dist/lib/variants.js +109 -0
- package/dist/locale-data/core/date.d.ts +24 -0
- package/dist/locale-data/core/date.js +68 -0
- package/dist/locale-data/core/decimal.d.ts +19 -0
- package/dist/locale-data/core/decimal.js +79 -0
- package/dist/locale-data/core/holidays.d.ts +30 -0
- package/dist/locale-data/core/holidays.js +79 -0
- package/dist/locale-data/core/iban.d.ts +29 -0
- package/dist/locale-data/core/iban.js +74 -0
- package/dist/locale-data/core/index.d.ts +7 -0
- package/dist/locale-data/core/index.js +6 -0
- package/dist/locale-data/core/types.d.ts +173 -0
- package/dist/locale-data/core/types.js +6 -0
- package/dist/locale-data/core/week-info.d.ts +23 -0
- package/dist/locale-data/core/week-info.js +85 -0
- package/dist/locale-data/core/working-days.d.ts +27 -0
- package/dist/locale-data/core/working-days.js +133 -0
- package/dist/locale-data/index.d.ts +2 -0
- package/dist/locale-data/index.js +4 -0
- package/dist/locale-data/tr/address-tr.json +1 -0
- package/dist/locale-data/tr/address.d.ts +23 -0
- package/dist/locale-data/tr/address.js +52 -0
- package/dist/locale-data/tr/holidays.d.ts +31 -0
- package/dist/locale-data/tr/holidays.js +81 -0
- package/dist/locale-data/tr/iban.d.ts +21 -0
- package/dist/locale-data/tr/iban.js +45 -0
- package/dist/locale-data/tr/id.d.ts +36 -0
- package/dist/locale-data/tr/id.js +120 -0
- package/dist/locale-data/tr/index.d.ts +12 -0
- package/dist/locale-data/tr/index.js +33 -0
- package/dist/locale-data/tr/kdv.d.ts +91 -0
- package/dist/locale-data/tr/kdv.js +222 -0
- package/dist/locales/en.d.ts +2102 -0
- package/dist/locales/en.js +2088 -0
- package/dist/locales/tr.d.ts +2086 -0
- package/dist/locales/tr.js +2087 -0
- package/dist/media/focal-point.d.ts +42 -0
- package/dist/media/focal-point.js +96 -0
- package/dist/media/gallery-layout.d.ts +19 -0
- package/dist/media/gallery-layout.js +61 -0
- package/dist/media/gallery.d.ts +64 -0
- package/dist/media/gallery.js +138 -0
- package/dist/media/image-cropper.d.ts +86 -0
- package/dist/media/image-cropper.js +170 -0
- package/dist/media/image-field.d.ts +115 -0
- package/dist/media/image-field.js +212 -0
- package/dist/media/index.d.ts +19 -0
- package/dist/media/index.js +23 -0
- package/dist/media/lightbox.d.ts +82 -0
- package/dist/media/lightbox.js +171 -0
- package/dist/media/link-preview.d.ts +97 -0
- package/dist/media/link-preview.js +177 -0
- package/dist/media/media-library.d.ts +244 -0
- package/dist/media/media-library.js +776 -0
- package/dist/media/media-picker.d.ts +96 -0
- package/dist/media/media-picker.js +209 -0
- package/dist/media/media-provider.d.ts +23 -0
- package/dist/media/media-provider.js +44 -0
- package/dist/media/media-utils.d.ts +39 -0
- package/dist/media/media-utils.js +145 -0
- package/dist/media/memory-adapter.d.ts +22 -0
- package/dist/media/memory-adapter.js +162 -0
- package/dist/media/rest-adapter.d.ts +90 -0
- package/dist/media/rest-adapter.js +208 -0
- package/dist/media/serp.d.ts +62 -0
- package/dist/media/serp.js +108 -0
- package/dist/media/test-fixtures.d.ts +3 -0
- package/dist/media/test-fixtures.js +37 -0
- package/dist/media/types.d.ts +183 -0
- package/dist/media/types.js +3 -0
- package/dist/media/use-pan-zoom.d.ts +51 -0
- package/dist/media/use-pan-zoom.js +156 -0
- package/dist/media/use-upload-queue.d.ts +64 -0
- package/dist/media/use-upload-queue.js +115 -0
- package/dist/media/video-player.d.ts +135 -0
- package/dist/media/video-player.js +319 -0
- package/dist/next/index.d.ts +42 -0
- package/dist/next/index.js +36 -0
- package/dist/render/block-renderer.d.ts +56 -0
- package/dist/render/block-renderer.js +137 -0
- package/dist/render/index.d.ts +6 -0
- package/dist/render/index.js +7 -0
- package/dist/render/prepare.d.ts +61 -0
- package/dist/render/prepare.js +119 -0
- package/dist/scheduler/core/duration.d.ts +83 -0
- package/dist/scheduler/core/duration.js +174 -0
- package/dist/scheduler/core/gantt.d.ts +63 -0
- package/dist/scheduler/core/gantt.js +226 -0
- package/dist/scheduler/core/index.d.ts +6 -0
- package/dist/scheduler/core/index.js +7 -0
- package/dist/scheduler/core/layout.d.ts +97 -0
- package/dist/scheduler/core/layout.js +249 -0
- package/dist/scheduler/core/time-scale.d.ts +89 -0
- package/dist/scheduler/core/time-scale.js +173 -0
- package/dist/scheduler/gantt.d.ts +125 -0
- package/dist/scheduler/gantt.js +532 -0
- package/dist/scheduler/index.d.ts +6 -0
- package/dist/scheduler/index.js +7 -0
- package/dist/scheduler/resource-calendar.d.ts +218 -0
- package/dist/scheduler/resource-calendar.js +661 -0
- package/dist/scheduler/scheduler.d.ts +168 -0
- package/dist/scheduler/scheduler.js +768 -0
- package/dist/scheduler/shared.d.ts +63 -0
- package/dist/scheduler/shared.js +145 -0
- package/dist/scheduler/time-tracker.d.ts +138 -0
- package/dist/scheduler/time-tracker.js +403 -0
- package/dist/sortable/core.d.ts +67 -0
- package/dist/sortable/core.js +167 -0
- package/dist/sortable/index.d.ts +8 -0
- package/dist/sortable/index.js +10 -0
- package/dist/sortable/kanban-core.d.ts +70 -0
- package/dist/sortable/kanban-core.js +67 -0
- package/dist/sortable/kanban.d.ts +147 -0
- package/dist/sortable/kanban.js +472 -0
- package/dist/sortable/sortable-list.d.ts +71 -0
- package/dist/sortable/sortable-list.js +76 -0
- package/dist/sortable/sortable-tree.d.ts +101 -0
- package/dist/sortable/sortable-tree.js +450 -0
- package/dist/sortable/sortable.d.ts +188 -0
- package/dist/sortable/sortable.js +485 -0
- package/dist/sortable/use-pointer-drag.d.ts +75 -0
- package/dist/sortable/use-pointer-drag.js +173 -0
- package/dist/sortable/use-time-scale.d.ts +11 -0
- package/dist/sortable/use-time-scale.js +19 -0
- package/dist/styles/base.css +51 -0
- package/dist/styles/blocks.css +949 -0
- package/dist/styles/calendar.css +642 -0
- package/dist/styles/charts.css +264 -0
- package/dist/styles/data.css +474 -0
- package/dist/styles/editors.css +1022 -0
- package/dist/styles/forms.css +406 -0
- package/dist/styles/media.css +515 -0
- package/dist/styles/navigation.css +293 -0
- package/dist/styles/overlays.css +244 -0
- package/dist/styles.css +742 -0
- package/package.json +156 -4
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ListState` ⇄ URL search params. React-free: `parseListState()` runs in a server component so
|
|
3
|
+
* the first HTML already has the right rows.
|
|
4
|
+
*
|
|
5
|
+
* `?q=jane&f=stage.in:proposal|won;value.gte:5000;created.relative:last_30_days&sort=-createdAt,name&page=2&size=50&sv=v_8k2`
|
|
6
|
+
*
|
|
7
|
+
* - values are URI-encoded; `|` separates multiple values (`in`, `between`)
|
|
8
|
+
* - unknown fields / operators and malformed values are dropped silently
|
|
9
|
+
* - `page` is 1-based in the URL, 0-based in `ListState`
|
|
10
|
+
* - column widths / visibility are not written (they are preferences, not position)
|
|
11
|
+
*/
|
|
12
|
+
import { clauseId, createListState, fieldOps, isCursorPage, isFilterGroup, opTakesNoValue } from "./types.js";
|
|
13
|
+
const DEFAULT_KEYS = { q: "q", filters: "f", sort: "sort", page: "page", size: "size", cursor: "cursor", view: "sv", density: "density" };
|
|
14
|
+
export function resolveUrlKeys(o = {}) {
|
|
15
|
+
const keys = { ...DEFAULT_KEYS, ...o.keys };
|
|
16
|
+
if (!o.prefix)
|
|
17
|
+
return keys;
|
|
18
|
+
return Object.fromEntries(Object.entries(keys).map(([k, v]) => [k, o.prefix + v]));
|
|
19
|
+
}
|
|
20
|
+
const decode = (s) => {
|
|
21
|
+
try {
|
|
22
|
+
return decodeURIComponent(s.replace(/\+/g, " "));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return s;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function readRaw(search) {
|
|
29
|
+
const s = search.startsWith("?") ? search.slice(1) : search;
|
|
30
|
+
if (!s)
|
|
31
|
+
return [];
|
|
32
|
+
return s
|
|
33
|
+
.split("&")
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.map((pair) => {
|
|
36
|
+
const i = pair.indexOf("=");
|
|
37
|
+
return i === -1 ? [decode(pair), ""] : [decode(pair.slice(0, i)), pair.slice(i + 1)];
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const enc = (s) => encodeURIComponent(s);
|
|
41
|
+
/** Filter-string value encoding: also escape the separators the format uses. */
|
|
42
|
+
const encValue = (s) => encodeURIComponent(s);
|
|
43
|
+
/** A decoded parameter value back to the raw form the parser expects (separators unescaped). */
|
|
44
|
+
const reRaw = (v) => encodeURIComponent(v).replace(/%7C/gi, "|").replace(/%3A/gi, ":").replace(/%3B/gi, ";").replace(/%2C/gi, ",");
|
|
45
|
+
/* ------------------------------------------------------------------ */
|
|
46
|
+
/* Filters */
|
|
47
|
+
/* ------------------------------------------------------------------ */
|
|
48
|
+
function encodeRelative(r) {
|
|
49
|
+
if (typeof r === "string")
|
|
50
|
+
return r;
|
|
51
|
+
return `${r.last}${r.unit[0]}`;
|
|
52
|
+
}
|
|
53
|
+
function decodeRelative(s) {
|
|
54
|
+
const m = /^(\d{1,3})([dwm])$/.exec(s);
|
|
55
|
+
if (m)
|
|
56
|
+
return { last: Number(m[1]), unit: m[2] === "d" ? "day" : m[2] === "w" ? "week" : "month" };
|
|
57
|
+
return /^[a-z_0-9]+$/.test(s) ? s : null;
|
|
58
|
+
}
|
|
59
|
+
const scalarToString = (v) => (typeof v === "object" && v !== null ? String(v.id ?? "") : String(v));
|
|
60
|
+
/** `stage.in:proposal|won;value.gte:5000` — the `f` parameter. Nested groups are flattened (simple mode). */
|
|
61
|
+
export function encodeFilters(g) {
|
|
62
|
+
const parts = [];
|
|
63
|
+
const walk = (group) => {
|
|
64
|
+
for (const c of group.clauses) {
|
|
65
|
+
if (isFilterGroup(c)) {
|
|
66
|
+
walk(c);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const head = `${encValue(c.field)}.${c.op}`;
|
|
70
|
+
if (opTakesNoValue(c.op)) {
|
|
71
|
+
parts.push(head);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (c.value === undefined || c.value === null || c.value === "")
|
|
75
|
+
continue;
|
|
76
|
+
let value;
|
|
77
|
+
if (c.op === "relative")
|
|
78
|
+
value = encodeRelative(c.value);
|
|
79
|
+
else if (Array.isArray(c.value))
|
|
80
|
+
value = c.value.map((v) => encValue(scalarToString(v))).join("|");
|
|
81
|
+
else
|
|
82
|
+
value = encValue(scalarToString(c.value));
|
|
83
|
+
if (!value)
|
|
84
|
+
continue;
|
|
85
|
+
parts.push(`${head}:${value}`);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
walk(g);
|
|
89
|
+
return parts.join(";");
|
|
90
|
+
}
|
|
91
|
+
function coerce(raw, field) {
|
|
92
|
+
const s = decode(raw);
|
|
93
|
+
if (!field)
|
|
94
|
+
return s;
|
|
95
|
+
if (field.type === "number" || field.type === "percent") {
|
|
96
|
+
const n = Number(s);
|
|
97
|
+
return Number.isFinite(n) ? n : undefined;
|
|
98
|
+
}
|
|
99
|
+
if (field.type === "currency")
|
|
100
|
+
return /^-?\d+(\.\d+)?$/.test(s) ? s : undefined;
|
|
101
|
+
if (field.type === "boolean")
|
|
102
|
+
return s === "true" ? true : s === "false" ? false : undefined;
|
|
103
|
+
if (field.type === "date")
|
|
104
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(s) ? s : undefined;
|
|
105
|
+
return s;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Parses the `f` parameter. With `fields`, unknown fields, operators a field does not allow and
|
|
109
|
+
* malformed values are dropped; without it every syntactically valid clause is kept as text.
|
|
110
|
+
*/
|
|
111
|
+
export function decodeFilters(raw, fields) {
|
|
112
|
+
const byField = fields ? new Map(fields.map((f) => [f.field, f])) : null;
|
|
113
|
+
const clauses = [];
|
|
114
|
+
for (const part of raw.split(";")) {
|
|
115
|
+
if (!part)
|
|
116
|
+
continue;
|
|
117
|
+
const colon = part.indexOf(":");
|
|
118
|
+
const head = colon === -1 ? part : part.slice(0, colon);
|
|
119
|
+
const body = colon === -1 ? "" : part.slice(colon + 1);
|
|
120
|
+
const dot = head.lastIndexOf(".");
|
|
121
|
+
if (dot <= 0)
|
|
122
|
+
continue;
|
|
123
|
+
const field = decode(head.slice(0, dot));
|
|
124
|
+
const op = head.slice(dot + 1);
|
|
125
|
+
const def = byField?.get(field);
|
|
126
|
+
if (byField && (!def || !fieldOps(def).includes(op)))
|
|
127
|
+
continue;
|
|
128
|
+
if (opTakesNoValue(op)) {
|
|
129
|
+
clauses.push({ id: clauseId(), field, op });
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (!body)
|
|
133
|
+
continue;
|
|
134
|
+
let value;
|
|
135
|
+
if (op === "relative") {
|
|
136
|
+
value = decodeRelative(decode(body));
|
|
137
|
+
}
|
|
138
|
+
else if (op === "in" || op === "notIn") {
|
|
139
|
+
const list = body.split("|").map((v) => decode(v)).filter(Boolean);
|
|
140
|
+
value = list.length ? list : undefined;
|
|
141
|
+
}
|
|
142
|
+
else if (op === "between") {
|
|
143
|
+
const pair = body.split("|").map((v) => coerce(v, def));
|
|
144
|
+
value = pair.length === 2 && pair.every((v) => v !== undefined && v !== "") ? pair : undefined;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
value = coerce(body, def);
|
|
148
|
+
}
|
|
149
|
+
if (value === undefined || value === null)
|
|
150
|
+
continue;
|
|
151
|
+
clauses.push({ id: clauseId(), field, op, value });
|
|
152
|
+
}
|
|
153
|
+
return { logic: "and", clauses };
|
|
154
|
+
}
|
|
155
|
+
/** The owned parameters of a list state, in a stable order. Values are already encoded. */
|
|
156
|
+
export function listStateToParams(state, o = {}) {
|
|
157
|
+
const k = resolveUrlKeys(o);
|
|
158
|
+
const d = createListState(o.defaults);
|
|
159
|
+
const out = [];
|
|
160
|
+
if (state.q.trim())
|
|
161
|
+
out.push([k.q, enc(state.q)]);
|
|
162
|
+
const f = encodeFilters(state.filters);
|
|
163
|
+
if (f && f !== encodeFilters(d.filters))
|
|
164
|
+
out.push([k.filters, f]);
|
|
165
|
+
const sort = state.sort.map((s) => (s.desc ? "-" : "") + encValue(s.id)).join(",");
|
|
166
|
+
const defSort = d.sort.map((s) => (s.desc ? "-" : "") + encValue(s.id)).join(",");
|
|
167
|
+
if (sort !== defSort)
|
|
168
|
+
out.push([k.sort, sort || "none"]);
|
|
169
|
+
if (isCursorPage(state.page)) {
|
|
170
|
+
if (state.page.cursor)
|
|
171
|
+
out.push([k.cursor, enc(state.page.cursor)]);
|
|
172
|
+
}
|
|
173
|
+
else if (state.page.index > 0)
|
|
174
|
+
out.push([k.page, String(state.page.index + 1)]);
|
|
175
|
+
if (state.page.size !== d.page.size)
|
|
176
|
+
out.push([k.size, String(state.page.size)]);
|
|
177
|
+
if (state.view)
|
|
178
|
+
out.push([k.view, enc(state.view)]);
|
|
179
|
+
if (o.density && state.density && state.density !== d.density)
|
|
180
|
+
out.push([k.density, state.density]);
|
|
181
|
+
return out;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* `ListState` → search string (no leading `?`). Defaults are omitted, so the canonical list has a clean URL.
|
|
185
|
+
*
|
|
186
|
+
* ```ts
|
|
187
|
+
* serializeListState(state, { defaults: { sort: [{ id: "createdAt", desc: true }] } });
|
|
188
|
+
* // "q=jane&f=stage.in:proposal|won&page=2"
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
export function serializeListState(state, o = {}) {
|
|
192
|
+
return listStateToParams(state, o)
|
|
193
|
+
.map(([key, v]) => `${enc(key)}=${v}`)
|
|
194
|
+
.join("&");
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Replaces the list's own parameters in an existing search string and keeps every other
|
|
198
|
+
* parameter (`?tab=deals&q=…`) in place.
|
|
199
|
+
*/
|
|
200
|
+
export function mergeListStateIntoSearch(search, state, o = {}) {
|
|
201
|
+
const k = resolveUrlKeys(o);
|
|
202
|
+
const owned = new Set(Object.values(k));
|
|
203
|
+
const kept = readRaw(search).filter(([key]) => !owned.has(key)).map(([key, raw]) => `${enc(key)}=${raw}`);
|
|
204
|
+
const own = listStateToParams(state, o).map(([key, v]) => `${enc(key)}=${v}`);
|
|
205
|
+
return [...kept, ...own].join("&");
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Search string (or `URLSearchParams`, or a Next.js `searchParams` object) → `ListState`.
|
|
209
|
+
* Safe on untrusted input: bad values fall back to the defaults.
|
|
210
|
+
*/
|
|
211
|
+
export function parseListState(input, o = {}) {
|
|
212
|
+
const k = resolveUrlKeys(o);
|
|
213
|
+
const base = createListState(o.defaults);
|
|
214
|
+
let raw;
|
|
215
|
+
if (typeof input === "string")
|
|
216
|
+
raw = readRaw(input);
|
|
217
|
+
else if (input instanceof URLSearchParams)
|
|
218
|
+
raw = [...input.entries()].map(([key, v]) => [key, reRaw(v)]);
|
|
219
|
+
else
|
|
220
|
+
raw = Object.entries(input).flatMap(([key, v]) => v === undefined ? [] : (Array.isArray(v) ? v : [v]).map((x) => [key, reRaw(x)]));
|
|
221
|
+
const get = (key) => raw.find(([n]) => n === key)?.[1];
|
|
222
|
+
const state = { ...base, columns: base.columns };
|
|
223
|
+
const q = get(k.q);
|
|
224
|
+
if (q !== undefined)
|
|
225
|
+
state.q = decode(q).slice(0, 500);
|
|
226
|
+
const f = get(k.filters);
|
|
227
|
+
if (f !== undefined)
|
|
228
|
+
state.filters = decodeFilters(f, o.fields);
|
|
229
|
+
const sort = get(k.sort);
|
|
230
|
+
if (sort !== undefined) {
|
|
231
|
+
const list = sort === "none" || sort === "" ? [] : sort.split(",").map((s) => (s.startsWith("-") ? { id: decode(s.slice(1)), desc: true } : { id: decode(s), desc: false }));
|
|
232
|
+
state.sort = list.filter((s) => s.id && (!o.sortable || o.sortable.includes(s.id)));
|
|
233
|
+
}
|
|
234
|
+
let size = base.page.size;
|
|
235
|
+
const sizeRaw = get(k.size);
|
|
236
|
+
if (sizeRaw !== undefined) {
|
|
237
|
+
const n = Number(sizeRaw);
|
|
238
|
+
if (Number.isInteger(n) && n > 0 && n <= 1000 && (!o.pageSizes || o.pageSizes.includes(n)))
|
|
239
|
+
size = n;
|
|
240
|
+
}
|
|
241
|
+
const cursor = get(k.cursor);
|
|
242
|
+
if (cursor !== undefined || isCursorPage(base.page)) {
|
|
243
|
+
state.page = { cursor: cursor ? decode(cursor) : null, size };
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
const p = Number(get(k.page) ?? 1);
|
|
247
|
+
state.page = { index: Number.isInteger(p) && p > 0 ? p - 1 : 0, size };
|
|
248
|
+
}
|
|
249
|
+
const view = get(k.view);
|
|
250
|
+
if (view !== undefined)
|
|
251
|
+
state.view = decode(view) || null;
|
|
252
|
+
const density = get(k.density);
|
|
253
|
+
if (density === "compact" || density === "comfortable" || density === "spacious")
|
|
254
|
+
state.density = density;
|
|
255
|
+
return state;
|
|
256
|
+
}
|
|
257
|
+
/* ------------------------------------------------------------------ */
|
|
258
|
+
/* Adapters */
|
|
259
|
+
/* ------------------------------------------------------------------ */
|
|
260
|
+
/**
|
|
261
|
+
* The built-in adapter: `history.replaceState` / `pushState` on the current URL. Works with the
|
|
262
|
+
* Next.js App Router (`useSearchParams` observes `history` updates). SSR-safe.
|
|
263
|
+
*/
|
|
264
|
+
export function createHistoryAdapter() {
|
|
265
|
+
return {
|
|
266
|
+
read: () => (typeof window === "undefined" ? "" : window.location.search),
|
|
267
|
+
write(search, mode) {
|
|
268
|
+
if (typeof window === "undefined")
|
|
269
|
+
return;
|
|
270
|
+
const url = `${window.location.pathname}${search ? `?${search}` : ""}${window.location.hash}`;
|
|
271
|
+
if (url === `${window.location.pathname}${window.location.search}${window.location.hash}`)
|
|
272
|
+
return;
|
|
273
|
+
if (mode === "push")
|
|
274
|
+
window.history.pushState(window.history.state, "", url);
|
|
275
|
+
else
|
|
276
|
+
window.history.replaceState(window.history.state, "", url);
|
|
277
|
+
},
|
|
278
|
+
subscribe(cb) {
|
|
279
|
+
if (typeof window === "undefined")
|
|
280
|
+
return () => { };
|
|
281
|
+
window.addEventListener("popstate", cb);
|
|
282
|
+
return () => window.removeEventListener("popstate", cb);
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
/** An in-memory adapter for tests, previews and embedded lists. */
|
|
287
|
+
export function createMemoryAdapter(initial = "") {
|
|
288
|
+
let search = initial.replace(/^\?/, "");
|
|
289
|
+
const subs = new Set();
|
|
290
|
+
return {
|
|
291
|
+
get search() {
|
|
292
|
+
return search;
|
|
293
|
+
},
|
|
294
|
+
read: () => search,
|
|
295
|
+
write(next) {
|
|
296
|
+
search = next;
|
|
297
|
+
},
|
|
298
|
+
subscribe(cb) {
|
|
299
|
+
subs.add(cb);
|
|
300
|
+
return () => subs.delete(cb);
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Saved-view helpers. React-free. */
|
|
2
|
+
import { type ListState, type SavedView, type ViewState } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* `true` when two view states describe the same list. Order-insensitive for filters and column
|
|
5
|
+
* visibility; ignores clause ids, page position and column widths under 4 px apart.
|
|
6
|
+
*/
|
|
7
|
+
export declare function viewStateEqual(a: ViewState, b: ViewState): boolean;
|
|
8
|
+
/** The part of a list state a saved view stores. */
|
|
9
|
+
export declare function toViewState(s: ListState): ViewState;
|
|
10
|
+
/** Applies a view to a list state: position resets to the first page, the view becomes active. */
|
|
11
|
+
export declare function applyViewState(current: ListState, view: ViewState | undefined, viewId: string | null, base?: Partial<ListState>): ListState;
|
|
12
|
+
/**
|
|
13
|
+
* Which view to open on load: URL `sv` → the user's default view → `null` ("All").
|
|
14
|
+
* A deleted id falls through to the default.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveInitialView(views: SavedView[], urlViewId?: string | null): SavedView | null;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** Saved-view helpers. React-free. */
|
|
2
|
+
import { createListState, isCursorPage, isFilterGroup } from "./types.js";
|
|
3
|
+
const canonValue = (v) => (Array.isArray(v) ? v.map(canonValue).map(String).sort() : v && typeof v === "object" ? JSON.stringify(v, Object.keys(v).sort()) : v);
|
|
4
|
+
function canonFilters(g) {
|
|
5
|
+
const items = g.clauses.map((c) => (isFilterGroup(c) ? canonFilters(c) : JSON.stringify([c.field, c.op, canonValue(c.value)]))).map((x) => (typeof x === "string" ? x : JSON.stringify(x)));
|
|
6
|
+
items.sort();
|
|
7
|
+
return { logic: items.length > 1 ? g.logic : "and", items };
|
|
8
|
+
}
|
|
9
|
+
/** Visibility with explicit `true` entries removed (missing = visible). */
|
|
10
|
+
const canonVisible = (v = {}) => Object.keys(v)
|
|
11
|
+
.filter((k) => v[k] === false)
|
|
12
|
+
.sort();
|
|
13
|
+
/**
|
|
14
|
+
* `true` when two view states describe the same list. Order-insensitive for filters and column
|
|
15
|
+
* visibility; ignores clause ids, page position and column widths under 4 px apart.
|
|
16
|
+
*/
|
|
17
|
+
export function viewStateEqual(a, b) {
|
|
18
|
+
if ((a.q ?? "").trim() !== (b.q ?? "").trim())
|
|
19
|
+
return false;
|
|
20
|
+
if (JSON.stringify(canonFilters(a.filters)) !== JSON.stringify(canonFilters(b.filters)))
|
|
21
|
+
return false;
|
|
22
|
+
if (JSON.stringify(a.sort ?? []) !== JSON.stringify(b.sort ?? []))
|
|
23
|
+
return false;
|
|
24
|
+
if ((a.density ?? null) !== (b.density ?? null))
|
|
25
|
+
return false;
|
|
26
|
+
if ((a.groupBy ?? null) !== (b.groupBy ?? null))
|
|
27
|
+
return false;
|
|
28
|
+
if (a.pageSize !== undefined && b.pageSize !== undefined && a.pageSize !== b.pageSize)
|
|
29
|
+
return false;
|
|
30
|
+
const ca = a.columns;
|
|
31
|
+
const cb = b.columns;
|
|
32
|
+
if (JSON.stringify(canonVisible(ca?.visible)) !== JSON.stringify(canonVisible(cb?.visible)))
|
|
33
|
+
return false;
|
|
34
|
+
const orderA = ca?.order ?? [];
|
|
35
|
+
const orderB = cb?.order ?? [];
|
|
36
|
+
if (orderA.length && orderB.length && orderA.join() !== orderB.join())
|
|
37
|
+
return false;
|
|
38
|
+
if (JSON.stringify(ca?.pinned ?? { start: [], end: [] }) !== JSON.stringify(cb?.pinned ?? { start: [], end: [] }))
|
|
39
|
+
return false;
|
|
40
|
+
const sizes = new Set([...Object.keys(ca?.sizing ?? {}), ...Object.keys(cb?.sizing ?? {})]);
|
|
41
|
+
for (const key of sizes) {
|
|
42
|
+
const x = ca?.sizing?.[key];
|
|
43
|
+
const y = cb?.sizing?.[key];
|
|
44
|
+
if (x !== undefined && y !== undefined && Math.abs(x - y) >= 4)
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
/** The part of a list state a saved view stores. */
|
|
50
|
+
export function toViewState(s) {
|
|
51
|
+
return { q: s.q || undefined, filters: s.filters, sort: s.sort, columns: s.columns, density: s.density, groupBy: s.groupBy ?? null, pageSize: s.page.size };
|
|
52
|
+
}
|
|
53
|
+
/** Applies a view to a list state: position resets to the first page, the view becomes active. */
|
|
54
|
+
export function applyViewState(current, view, viewId, base) {
|
|
55
|
+
const reset = createListState(base, current.page.size);
|
|
56
|
+
const source = view ?? toViewState(reset);
|
|
57
|
+
const size = source.pageSize ?? current.page.size;
|
|
58
|
+
return {
|
|
59
|
+
...current,
|
|
60
|
+
q: source.q ?? "",
|
|
61
|
+
filters: source.filters ?? reset.filters,
|
|
62
|
+
sort: source.sort ?? reset.sort,
|
|
63
|
+
columns: { ...reset.columns, ...source.columns, pinned: source.columns?.pinned ?? { start: [], end: [] } },
|
|
64
|
+
density: source.density ?? reset.density,
|
|
65
|
+
groupBy: source.groupBy ?? null,
|
|
66
|
+
page: isCursorPage(current.page) ? { cursor: null, size } : { index: 0, size },
|
|
67
|
+
view: viewId,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Which view to open on load: URL `sv` → the user's default view → `null` ("All").
|
|
72
|
+
* A deleted id falls through to the default.
|
|
73
|
+
*/
|
|
74
|
+
export function resolveInitialView(views, urlViewId) {
|
|
75
|
+
if (urlViewId) {
|
|
76
|
+
const hit = views.find((v) => v.id === urlViewId);
|
|
77
|
+
if (hit)
|
|
78
|
+
return hit;
|
|
79
|
+
}
|
|
80
|
+
return views.find((v) => v.isDefault) ?? null;
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// jsdom gaps ProseMirror needs (layout APIs). Imported by the editor tests only.
|
|
2
|
+
const rect = () => ({ x: 0, y: 0, top: 0, left: 0, bottom: 0, right: 0, width: 0, height: 0, toJSON() { } });
|
|
3
|
+
if (typeof Range !== "undefined") {
|
|
4
|
+
Range.prototype.getBoundingClientRect ??= rect;
|
|
5
|
+
Range.prototype.getClientRects ??= () => ({ length: 0, item: () => null, [Symbol.iterator]: [][Symbol.iterator] });
|
|
6
|
+
}
|
|
7
|
+
if (typeof document !== "undefined") {
|
|
8
|
+
document.elementFromPoint ??= () => null;
|
|
9
|
+
document.caretRangeFromPoint ??= () => null;
|
|
10
|
+
}
|
|
11
|
+
if (typeof window !== "undefined") {
|
|
12
|
+
window.requestAnimationFrame ??= ((cb) => setTimeout(() => cb(0), 0));
|
|
13
|
+
}
|
|
14
|
+
if (typeof DOMRect === "undefined") {
|
|
15
|
+
globalThis.DOMRect = class {
|
|
16
|
+
x;
|
|
17
|
+
y;
|
|
18
|
+
width;
|
|
19
|
+
height;
|
|
20
|
+
constructor(x = 0, y = 0, width = 0, height = 0) {
|
|
21
|
+
this.x = x;
|
|
22
|
+
this.y = y;
|
|
23
|
+
this.width = width;
|
|
24
|
+
this.height = height;
|
|
25
|
+
}
|
|
26
|
+
get top() { return this.y; }
|
|
27
|
+
get left() { return this.x; }
|
|
28
|
+
get bottom() { return this.y + this.height; }
|
|
29
|
+
get right() { return this.x + this.width; }
|
|
30
|
+
toJSON() { return {}; }
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Editor } from "@tiptap/react";
|
|
3
|
+
import { type BlockRegistry } from "../blocks/schema/define-block.js";
|
|
4
|
+
import type { RichDoc } from "../blocks/schema/rich-doc.js";
|
|
5
|
+
import type { VamosDoc } from "../blocks/schema/types.js";
|
|
6
|
+
import type { MediaAdapter } from "../media/types.js";
|
|
7
|
+
import { type BlockEditorLabels } from "./labels.js";
|
|
8
|
+
import { type BlockEditorContextValue, type BlockEditorVariant, type BlockPattern, type ImageUploader, type LinkSuggestion } from "./context.js";
|
|
9
|
+
export interface BlockEditorHandle {
|
|
10
|
+
focus(): void;
|
|
11
|
+
/** Inserts a block after the current one. `type` is a text type ("heading-2", "table") or a registry type ("hero"). */
|
|
12
|
+
insertBlock(type: string, props?: Record<string, unknown>): void;
|
|
13
|
+
/** The current content as a VamosDoc (not debounced). */
|
|
14
|
+
getDoc(): VamosDoc;
|
|
15
|
+
undo(): void;
|
|
16
|
+
redo(): void;
|
|
17
|
+
/** Tiptap escape hatch. */
|
|
18
|
+
editor: Editor | null;
|
|
19
|
+
}
|
|
20
|
+
export interface BlockEditorChangeInfo {
|
|
21
|
+
wordCount: number;
|
|
22
|
+
changedBlockIds: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface BlockEditorProps {
|
|
25
|
+
value?: VamosDoc;
|
|
26
|
+
defaultValue?: VamosDoc;
|
|
27
|
+
/** Debounced (300 ms). The editor's own state is the truth while typing. */
|
|
28
|
+
onChange?: (doc: VamosDoc, info: BlockEditorChangeInfo) => void;
|
|
29
|
+
/** Blocks available to insert and render. Default: none (text blocks only). */
|
|
30
|
+
registry?: BlockRegistry;
|
|
31
|
+
/**
|
|
32
|
+
* `"document"`: a ~720px reading column (posts, KB) · `"canvas"`: full-width page builder ·
|
|
33
|
+
* `"rich-text"`: compact field, text blocks only, no inserter or drag handle.
|
|
34
|
+
*/
|
|
35
|
+
variant?: BlockEditorVariant;
|
|
36
|
+
/** Rich-text size. Default `"md"`. */
|
|
37
|
+
size?: "sm" | "md";
|
|
38
|
+
/** Block types that may be inserted (text types are `paragraph`, `heading`, `list`, `quote`, `code`, `divider`, `table`, `image`). */
|
|
39
|
+
allowedBlocks?: string[] | ((ctx: {
|
|
40
|
+
parentType?: string;
|
|
41
|
+
}) => string[]);
|
|
42
|
+
patterns?: BlockPattern[];
|
|
43
|
+
/** Placeholder of an empty editor. Dictionary default: "Type / to add a block". */
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
readOnly?: boolean;
|
|
46
|
+
/** Paste / drop images → upload. Default: the `VamosProvider` media adapter. */
|
|
47
|
+
media?: MediaAdapter;
|
|
48
|
+
/** Custom image upload (wins over `media`). */
|
|
49
|
+
uploadImage?: ImageUploader;
|
|
50
|
+
/** Internal link suggestions in the link editor. */
|
|
51
|
+
linkSearch?: (q: string) => Promise<LinkSuggestion[]>;
|
|
52
|
+
/** Site theme axes for the canvas, so blocks look exactly as they will live. */
|
|
53
|
+
canvasTheme?: {
|
|
54
|
+
accent?: string;
|
|
55
|
+
font?: string;
|
|
56
|
+
density?: string;
|
|
57
|
+
theme?: "light" | "dark";
|
|
58
|
+
};
|
|
59
|
+
/** Content language (spellcheck, hyphenation, word counting). Default `value.lang` → UI locale. */
|
|
60
|
+
lang?: string;
|
|
61
|
+
editorRef?: React.Ref<BlockEditorHandle>;
|
|
62
|
+
/** Accessible name of the text area. Default "Content". */
|
|
63
|
+
"aria-label"?: string;
|
|
64
|
+
"aria-labelledby"?: string;
|
|
65
|
+
/** Min / max height of the rich-text field (CSS length). */
|
|
66
|
+
minHeight?: string;
|
|
67
|
+
maxHeight?: string;
|
|
68
|
+
/** Rich-text: show the fixed toolbar. Default true. */
|
|
69
|
+
toolbar?: boolean;
|
|
70
|
+
/** Autofocus on mount. */
|
|
71
|
+
autoFocus?: boolean;
|
|
72
|
+
labels?: Partial<BlockEditorLabels>;
|
|
73
|
+
className?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Parts to render. Default per variant: content + bubble menu + "/" menu (+ drag handle and
|
|
76
|
+
* inserter for document/canvas, + toolbar for rich-text). Pass your own composition to add
|
|
77
|
+
* `BlockInspector`, `BlockEditorOutline` or a custom layout.
|
|
78
|
+
*/
|
|
79
|
+
children?: React.ReactNode;
|
|
80
|
+
/** @internal value format used by RichTextEditor. */
|
|
81
|
+
format?: "doc" | "rich";
|
|
82
|
+
/** @internal */
|
|
83
|
+
richValue?: RichDoc;
|
|
84
|
+
/** @internal */
|
|
85
|
+
defaultRichValue?: RichDoc;
|
|
86
|
+
/** @internal */
|
|
87
|
+
onRichChange?: (doc: RichDoc) => void;
|
|
88
|
+
/** @internal Field wiring. */
|
|
89
|
+
a11y?: BlockEditorContextValue["a11y"];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The block editor: text blocks edited inline, page blocks rendered by the very component the
|
|
93
|
+
* site uses (via the registry), a "/" inserter, a bubble menu on selection, a drag handle with a
|
|
94
|
+
* keyboard-equivalent block menu, and a schema-generated inspector. Reads and writes `VamosDoc`.
|
|
95
|
+
*
|
|
96
|
+
* ```tsx
|
|
97
|
+
* <BlockEditor value={doc} onChange={setDoc} registry={siteBlocks} variant="document" />
|
|
98
|
+
*
|
|
99
|
+
* <BlockEditor value={doc} onChange={setDoc} registry={siteBlocks}>
|
|
100
|
+
* <BlockEditorContent />
|
|
101
|
+
* <BlockEditorBubbleMenu />
|
|
102
|
+
* <BlockEditorSlashMenu />
|
|
103
|
+
* <BlockEditorDragHandle />
|
|
104
|
+
* <aside><BlockInspector /></aside>
|
|
105
|
+
* </BlockEditor>
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export declare function BlockEditor(props: BlockEditorProps): React.JSX.Element;
|
|
109
|
+
export interface BlockEditorContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The editable canvas. Wears the site theme (`canvasTheme`) and is always `solid`, even inside a
|
|
113
|
+
* glass admin, for long-text readability and scroll performance.
|
|
114
|
+
*/
|
|
115
|
+
export declare const BlockEditorContent: React.ForwardRefExoticComponent<BlockEditorContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
116
|
+
export interface RichTextEditorProps extends Omit<BlockEditorProps, "value" | "defaultValue" | "onChange" | "variant" | "registry" | "patterns" | "format" | "richValue" | "defaultRichValue" | "onRichChange" | "a11y" | "canvasTheme" | "allowedBlocks"> {
|
|
117
|
+
/** A RichDoc (the value of `f.rich()` fields): paragraphs, h2–h4, lists, quotes, code, rules. */
|
|
118
|
+
value?: RichDoc;
|
|
119
|
+
defaultValue?: RichDoc;
|
|
120
|
+
/** Debounced (300 ms). */
|
|
121
|
+
onChange?: (doc: RichDoc) => void;
|
|
122
|
+
id?: string;
|
|
123
|
+
invalid?: boolean;
|
|
124
|
+
required?: boolean;
|
|
125
|
+
"aria-describedby"?: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Compact rich-text field for notes, comments, CRM activities and HR announcements. Same engine
|
|
129
|
+
* as BlockEditor (`variant="rich-text"`), RichDoc in and out, Field-aware like Textarea.
|
|
130
|
+
*
|
|
131
|
+
* ```tsx
|
|
132
|
+
* <Field label="Note" hint="Visible to your team only.">
|
|
133
|
+
* <RichTextEditor value={note} onChange={setNote} size="sm" minHeight="6rem" />
|
|
134
|
+
* </Field>
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
export declare function RichTextEditor({ value, defaultValue, onChange, id, invalid, required, "aria-describedby": describedBy, "aria-labelledby": labelledBy, ...rest }: RichTextEditorProps): React.JSX.Element;
|