@bestagentkits/render 0.1.1-next.1 → 0.3.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/CHANGELOG.md +209 -1
- package/README.md +324 -44
- package/assets/fonts/bricolage-grotesque/OFL.txt +93 -0
- package/assets/fonts/fraunces/OFL.txt +93 -0
- package/assets/fonts/geist/OFL.txt +93 -0
- package/assets/fonts/inter-tight/OFL.txt +93 -0
- package/assets/fonts/jetbrains-mono/OFL.txt +93 -0
- package/assets/fonts/plus-jakarta-sans/OFL.txt +93 -0
- package/dist/blocks/chart/chart-check-kind-rules.d.ts +10 -0
- package/dist/blocks/chart/chart-check-kind-rules.d.ts.map +1 -0
- package/dist/blocks/chart/chart-check-kind-rules.js +151 -0
- package/dist/blocks/chart/chart-check-kind-rules.js.map +1 -0
- package/dist/blocks/chart/chart-check.d.ts +15 -0
- package/dist/blocks/chart/chart-check.d.ts.map +1 -0
- package/dist/blocks/chart/chart-check.js +196 -0
- package/dist/blocks/chart/chart-check.js.map +1 -0
- package/dist/blocks/chart/chart-encoding-schema.d.ts +7 -0
- package/dist/blocks/chart/chart-encoding-schema.d.ts.map +1 -0
- package/dist/blocks/chart/chart-encoding-schema.js +39 -0
- package/dist/blocks/chart/chart-encoding-schema.js.map +1 -0
- package/dist/blocks/chart/chart-encodings.d.ts +29 -0
- package/dist/blocks/chart/chart-encodings.d.ts.map +1 -0
- package/dist/blocks/chart/chart-encodings.js +59 -0
- package/dist/blocks/chart/chart-encodings.js.map +1 -0
- package/dist/blocks/chart/chart-kinds.d.ts +18 -0
- package/dist/blocks/chart/chart-kinds.d.ts.map +1 -0
- package/dist/blocks/chart/chart-kinds.js +60 -0
- package/dist/blocks/chart/chart-kinds.js.map +1 -0
- package/dist/blocks/chart/chart-model-rows.d.ts +23 -0
- package/dist/blocks/chart/chart-model-rows.d.ts.map +1 -0
- package/dist/blocks/chart/chart-model-rows.js +153 -0
- package/dist/blocks/chart/chart-model-rows.js.map +1 -0
- package/dist/blocks/chart/chart-model.d.ts +17 -0
- package/dist/blocks/chart/chart-model.d.ts.map +1 -0
- package/dist/blocks/chart/chart-model.js +131 -0
- package/dist/blocks/chart/chart-model.js.map +1 -0
- package/dist/blocks/chart/chart-styles.d.ts +3 -0
- package/dist/blocks/chart/chart-styles.d.ts.map +1 -0
- package/dist/blocks/chart/chart-styles.js +76 -0
- package/dist/blocks/chart/chart-styles.js.map +1 -0
- package/dist/blocks/chart/chart.d.ts +12 -0
- package/dist/blocks/chart/chart.d.ts.map +1 -0
- package/dist/blocks/chart/chart.js +73 -0
- package/dist/blocks/chart/chart.js.map +1 -0
- package/dist/blocks/chart/index.d.ts +4 -0
- package/dist/blocks/chart/index.d.ts.map +1 -0
- package/dist/blocks/chart/index.js +8 -0
- package/dist/blocks/chart/index.js.map +1 -0
- package/dist/blocks/composition/accordion.d.ts +4 -0
- package/dist/blocks/composition/accordion.d.ts.map +1 -0
- package/dist/blocks/composition/accordion.js +45 -0
- package/dist/blocks/composition/accordion.js.map +1 -0
- package/dist/blocks/composition/bento.d.ts +4 -0
- package/dist/blocks/composition/bento.d.ts.map +1 -0
- package/dist/blocks/composition/bento.js +91 -0
- package/dist/blocks/composition/bento.js.map +1 -0
- package/dist/blocks/composition/carousel.d.ts +4 -0
- package/dist/blocks/composition/carousel.d.ts.map +1 -0
- package/dist/blocks/composition/carousel.js +51 -0
- package/dist/blocks/composition/carousel.js.map +1 -0
- package/dist/blocks/composition/composition-runtime.d.ts +14 -0
- package/dist/blocks/composition/composition-runtime.d.ts.map +1 -0
- package/dist/blocks/composition/composition-runtime.js +136 -0
- package/dist/blocks/composition/composition-runtime.js.map +1 -0
- package/dist/blocks/composition/composition-styles.d.ts +10 -0
- package/dist/blocks/composition/composition-styles.d.ts.map +1 -0
- package/dist/blocks/composition/composition-styles.js +80 -0
- package/dist/blocks/composition/composition-styles.js.map +1 -0
- package/dist/blocks/composition/index.d.ts +4 -0
- package/dist/blocks/composition/index.d.ts.map +1 -0
- package/dist/blocks/composition/index.js +11 -0
- package/dist/blocks/composition/index.js.map +1 -0
- package/dist/blocks/composition/nestable-blocks.d.ts +37 -0
- package/dist/blocks/composition/nestable-blocks.d.ts.map +1 -0
- package/dist/blocks/composition/nestable-blocks.js +92 -0
- package/dist/blocks/composition/nestable-blocks.js.map +1 -0
- package/dist/blocks/composition/tabs.d.ts +4 -0
- package/dist/blocks/composition/tabs.d.ts.map +1 -0
- package/dist/blocks/composition/tabs.js +48 -0
- package/dist/blocks/composition/tabs.js.map +1 -0
- package/dist/blocks/controls/checkbox.d.ts +12 -0
- package/dist/blocks/controls/checkbox.d.ts.map +1 -0
- package/dist/blocks/controls/checkbox.js +43 -0
- package/dist/blocks/controls/checkbox.js.map +1 -0
- package/dist/blocks/controls/choice-options.d.ts +24 -0
- package/dist/blocks/controls/choice-options.d.ts.map +1 -0
- package/dist/blocks/controls/choice-options.js +117 -0
- package/dist/blocks/controls/choice-options.js.map +1 -0
- package/dist/blocks/controls/control-shared.d.ts +66 -0
- package/dist/blocks/controls/control-shared.d.ts.map +1 -0
- package/dist/blocks/controls/control-shared.js +241 -0
- package/dist/blocks/controls/control-shared.js.map +1 -0
- package/dist/blocks/controls/controls-runtime.d.ts +17 -0
- package/dist/blocks/controls/controls-runtime.d.ts.map +1 -0
- package/dist/blocks/controls/controls-runtime.js +180 -0
- package/dist/blocks/controls/controls-runtime.js.map +1 -0
- package/dist/blocks/controls/controls-styles.d.ts +14 -0
- package/dist/blocks/controls/controls-styles.d.ts.map +1 -0
- package/dist/blocks/controls/controls-styles.js +54 -0
- package/dist/blocks/controls/controls-styles.js.map +1 -0
- package/dist/blocks/controls/date-input.d.ts +6 -0
- package/dist/blocks/controls/date-input.d.ts.map +1 -0
- package/dist/blocks/controls/date-input.js +58 -0
- package/dist/blocks/controls/date-input.js.map +1 -0
- package/dist/blocks/controls/field-input.d.ts +10 -0
- package/dist/blocks/controls/field-input.d.ts.map +1 -0
- package/dist/blocks/controls/field-input.js +20 -0
- package/dist/blocks/controls/field-input.js.map +1 -0
- package/dist/blocks/controls/filter-bar.d.ts +11 -0
- package/dist/blocks/controls/filter-bar.d.ts.map +1 -0
- package/dist/blocks/controls/filter-bar.js +115 -0
- package/dist/blocks/controls/filter-bar.js.map +1 -0
- package/dist/blocks/controls/index.d.ts +4 -0
- package/dist/blocks/controls/index.d.ts.map +1 -0
- package/dist/blocks/controls/index.js +41 -0
- package/dist/blocks/controls/index.js.map +1 -0
- package/dist/blocks/controls/number-input.d.ts +4 -0
- package/dist/blocks/controls/number-input.d.ts.map +1 -0
- package/dist/blocks/controls/number-input.js +62 -0
- package/dist/blocks/controls/number-input.js.map +1 -0
- package/dist/blocks/controls/radio-group.d.ts +4 -0
- package/dist/blocks/controls/radio-group.d.ts.map +1 -0
- package/dist/blocks/controls/radio-group.js +56 -0
- package/dist/blocks/controls/radio-group.js.map +1 -0
- package/dist/blocks/controls/select.d.ts +4 -0
- package/dist/blocks/controls/select.d.ts.map +1 -0
- package/dist/blocks/controls/select.js +49 -0
- package/dist/blocks/controls/select.js.map +1 -0
- package/dist/blocks/controls/switch.d.ts +4 -0
- package/dist/blocks/controls/switch.d.ts.map +1 -0
- package/dist/blocks/controls/switch.js +22 -0
- package/dist/blocks/controls/switch.js.map +1 -0
- package/dist/blocks/controls/text-input.d.ts +4 -0
- package/dist/blocks/controls/text-input.d.ts.map +1 -0
- package/dist/blocks/controls/text-input.js +42 -0
- package/dist/blocks/controls/text-input.js.map +1 -0
- package/dist/blocks/data-table/data-table-cells.d.ts +26 -0
- package/dist/blocks/data-table/data-table-cells.d.ts.map +1 -0
- package/dist/blocks/data-table/data-table-cells.js +154 -0
- package/dist/blocks/data-table/data-table-cells.js.map +1 -0
- package/dist/blocks/data-table/data-table-check.d.ts +10 -0
- package/dist/blocks/data-table/data-table-check.d.ts.map +1 -0
- package/dist/blocks/data-table/data-table-check.js +99 -0
- package/dist/blocks/data-table/data-table-check.js.map +1 -0
- package/dist/blocks/data-table/data-table-columns.d.ts +41 -0
- package/dist/blocks/data-table/data-table-columns.d.ts.map +1 -0
- package/dist/blocks/data-table/data-table-columns.js +155 -0
- package/dist/blocks/data-table/data-table-columns.js.map +1 -0
- package/dist/blocks/data-table/data-table-runtime.d.ts +15 -0
- package/dist/blocks/data-table/data-table-runtime.d.ts.map +1 -0
- package/dist/blocks/data-table/data-table-runtime.js +106 -0
- package/dist/blocks/data-table/data-table-runtime.js.map +1 -0
- package/dist/blocks/data-table/data-table-styles.d.ts +11 -0
- package/dist/blocks/data-table/data-table-styles.d.ts.map +1 -0
- package/dist/blocks/data-table/data-table-styles.js +74 -0
- package/dist/blocks/data-table/data-table-styles.js.map +1 -0
- package/dist/blocks/data-table/data-table.d.ts +17 -0
- package/dist/blocks/data-table/data-table.d.ts.map +1 -0
- package/dist/blocks/data-table/data-table.js +159 -0
- package/dist/blocks/data-table/data-table.js.map +1 -0
- package/dist/blocks/data-table/index.d.ts +4 -0
- package/dist/blocks/data-table/index.d.ts.map +1 -0
- package/dist/blocks/data-table/index.js +18 -0
- package/dist/blocks/data-table/index.js.map +1 -0
- package/dist/blocks/engineering/api-endpoint.d.ts +12 -0
- package/dist/blocks/engineering/api-endpoint.d.ts.map +1 -0
- package/dist/blocks/engineering/api-endpoint.js +174 -0
- package/dist/blocks/engineering/api-endpoint.js.map +1 -0
- package/dist/blocks/engineering/engineering-helpers.d.ts +49 -0
- package/dist/blocks/engineering/engineering-helpers.d.ts.map +1 -0
- package/dist/blocks/engineering/engineering-helpers.js +156 -0
- package/dist/blocks/engineering/engineering-helpers.js.map +1 -0
- package/dist/blocks/engineering/engineering-styles.d.ts +12 -0
- package/dist/blocks/engineering/engineering-styles.d.ts.map +1 -0
- package/dist/blocks/engineering/engineering-styles.js +174 -0
- package/dist/blocks/engineering/engineering-styles.js.map +1 -0
- package/dist/blocks/engineering/index.d.ts +4 -0
- package/dist/blocks/engineering/index.d.ts.map +1 -0
- package/dist/blocks/engineering/index.js +30 -0
- package/dist/blocks/engineering/index.js.map +1 -0
- package/dist/blocks/engineering/kanban.d.ts +11 -0
- package/dist/blocks/engineering/kanban.d.ts.map +1 -0
- package/dist/blocks/engineering/kanban.js +162 -0
- package/dist/blocks/engineering/kanban.js.map +1 -0
- package/dist/blocks/engineering/log-viewer.d.ts +14 -0
- package/dist/blocks/engineering/log-viewer.d.ts.map +1 -0
- package/dist/blocks/engineering/log-viewer.js +158 -0
- package/dist/blocks/engineering/log-viewer.js.map +1 -0
- package/dist/blocks/engineering/roadmap.d.ts +13 -0
- package/dist/blocks/engineering/roadmap.d.ts.map +1 -0
- package/dist/blocks/engineering/roadmap.js +197 -0
- package/dist/blocks/engineering/roadmap.js.map +1 -0
- package/dist/blocks/engineering/schema-viewer.d.ts +25 -0
- package/dist/blocks/engineering/schema-viewer.d.ts.map +1 -0
- package/dist/blocks/engineering/schema-viewer.js +124 -0
- package/dist/blocks/engineering/schema-viewer.js.map +1 -0
- package/dist/blocks/engineering/test-results.d.ts +12 -0
- package/dist/blocks/engineering/test-results.d.ts.map +1 -0
- package/dist/blocks/engineering/test-results.js +180 -0
- package/dist/blocks/engineering/test-results.js.map +1 -0
- package/dist/blocks/evidence/annotated-image.d.ts +15 -0
- package/dist/blocks/evidence/annotated-image.d.ts.map +1 -0
- package/dist/blocks/evidence/annotated-image.js +99 -0
- package/dist/blocks/evidence/annotated-image.js.map +1 -0
- package/dist/blocks/evidence/benchmark-comparison.d.ts +11 -0
- package/dist/blocks/evidence/benchmark-comparison.d.ts.map +1 -0
- package/dist/blocks/evidence/benchmark-comparison.js +262 -0
- package/dist/blocks/evidence/benchmark-comparison.js.map +1 -0
- package/dist/blocks/evidence/benchmark-verdict.d.ts +26 -0
- package/dist/blocks/evidence/benchmark-verdict.d.ts.map +1 -0
- package/dist/blocks/evidence/benchmark-verdict.js +31 -0
- package/dist/blocks/evidence/benchmark-verdict.js.map +1 -0
- package/dist/blocks/evidence/evidence-helpers.d.ts +39 -0
- package/dist/blocks/evidence/evidence-helpers.d.ts.map +1 -0
- package/dist/blocks/evidence/evidence-helpers.js +87 -0
- package/dist/blocks/evidence/evidence-helpers.js.map +1 -0
- package/dist/blocks/evidence/evidence-styles.d.ts +12 -0
- package/dist/blocks/evidence/evidence-styles.d.ts.map +1 -0
- package/dist/blocks/evidence/evidence-styles.js +88 -0
- package/dist/blocks/evidence/evidence-styles.js.map +1 -0
- package/dist/blocks/evidence/index.d.ts +4 -0
- package/dist/blocks/evidence/index.d.ts.map +1 -0
- package/dist/blocks/evidence/index.js +15 -0
- package/dist/blocks/evidence/index.js.map +1 -0
- package/dist/blocks/evidence/metric-breakdown.d.ts +22 -0
- package/dist/blocks/evidence/metric-breakdown.d.ts.map +1 -0
- package/dist/blocks/evidence/metric-breakdown.js +203 -0
- package/dist/blocks/evidence/metric-breakdown.js.map +1 -0
- package/dist/blocks/evidence/references.d.ts +13 -0
- package/dist/blocks/evidence/references.d.ts.map +1 -0
- package/dist/blocks/evidence/references.js +103 -0
- package/dist/blocks/evidence/references.js.map +1 -0
- package/dist/blocks/index.d.ts +8 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +24 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/layout/grid-item.d.ts +4 -0
- package/dist/blocks/layout/grid-item.d.ts.map +1 -0
- package/dist/blocks/layout/grid-item.js +65 -0
- package/dist/blocks/layout/grid-item.js.map +1 -0
- package/dist/blocks/layout/grid.d.ts +9 -0
- package/dist/blocks/layout/grid.d.ts.map +1 -0
- package/dist/blocks/layout/grid.js +99 -0
- package/dist/blocks/layout/grid.js.map +1 -0
- package/dist/blocks/layout/index.d.ts +4 -0
- package/dist/blocks/layout/index.d.ts.map +1 -0
- package/dist/blocks/layout/index.js +23 -0
- package/dist/blocks/layout/index.js.map +1 -0
- package/dist/blocks/layout/layout-styles.d.ts +40 -0
- package/dist/blocks/layout/layout-styles.d.ts.map +1 -0
- package/dist/blocks/layout/layout-styles.js +110 -0
- package/dist/blocks/layout/layout-styles.js.map +1 -0
- package/dist/blocks/layout/main-aside.d.ts +4 -0
- package/dist/blocks/layout/main-aside.d.ts.map +1 -0
- package/dist/blocks/layout/main-aside.js +21 -0
- package/dist/blocks/layout/main-aside.js.map +1 -0
- package/dist/blocks/layout/rail-layout.d.ts +4 -0
- package/dist/blocks/layout/rail-layout.d.ts.map +1 -0
- package/dist/blocks/layout/rail-layout.js +33 -0
- package/dist/blocks/layout/rail-layout.js.map +1 -0
- package/dist/blocks/layout/semantic-layout-parts.d.ts +14 -0
- package/dist/blocks/layout/semantic-layout-parts.d.ts.map +1 -0
- package/dist/blocks/layout/semantic-layout-parts.js +9 -0
- package/dist/blocks/layout/semantic-layout-parts.js.map +1 -0
- package/dist/blocks/layout/sidebar-layout.d.ts +4 -0
- package/dist/blocks/layout/sidebar-layout.d.ts.map +1 -0
- package/dist/blocks/layout/sidebar-layout.js +30 -0
- package/dist/blocks/layout/sidebar-layout.js.map +1 -0
- package/dist/blocks/layout/split.d.ts +4 -0
- package/dist/blocks/layout/split.d.ts.map +1 -0
- package/dist/blocks/layout/split.js +23 -0
- package/dist/blocks/layout/split.js.map +1 -0
- package/dist/blocks/layout/stack.d.ts +4 -0
- package/dist/blocks/layout/stack.d.ts.map +1 -0
- package/dist/blocks/layout/stack.js +36 -0
- package/dist/blocks/layout/stack.js.map +1 -0
- package/dist/blocks/product/calendar-dates.d.ts +59 -0
- package/dist/blocks/product/calendar-dates.d.ts.map +1 -0
- package/dist/blocks/product/calendar-dates.js +100 -0
- package/dist/blocks/product/calendar-dates.js.map +1 -0
- package/dist/blocks/product/calendar.d.ts +12 -0
- package/dist/blocks/product/calendar.d.ts.map +1 -0
- package/dist/blocks/product/calendar.js +125 -0
- package/dist/blocks/product/calendar.js.map +1 -0
- package/dist/blocks/product/feature-matrix.d.ts +4 -0
- package/dist/blocks/product/feature-matrix.d.ts.map +1 -0
- package/dist/blocks/product/feature-matrix.js +72 -0
- package/dist/blocks/product/feature-matrix.js.map +1 -0
- package/dist/blocks/product/gallery.d.ts +14 -0
- package/dist/blocks/product/gallery.d.ts.map +1 -0
- package/dist/blocks/product/gallery.js +86 -0
- package/dist/blocks/product/gallery.js.map +1 -0
- package/dist/blocks/product/index.d.ts +4 -0
- package/dist/blocks/product/index.d.ts.map +1 -0
- package/dist/blocks/product/index.js +40 -0
- package/dist/blocks/product/index.js.map +1 -0
- package/dist/blocks/product/logo-cloud.d.ts +4 -0
- package/dist/blocks/product/logo-cloud.d.ts.map +1 -0
- package/dist/blocks/product/logo-cloud.js +42 -0
- package/dist/blocks/product/logo-cloud.js.map +1 -0
- package/dist/blocks/product/people.d.ts +4 -0
- package/dist/blocks/product/people.d.ts.map +1 -0
- package/dist/blocks/product/people.js +53 -0
- package/dist/blocks/product/people.js.map +1 -0
- package/dist/blocks/product/pricing.d.ts +4 -0
- package/dist/blocks/product/pricing.d.ts.map +1 -0
- package/dist/blocks/product/pricing.js +86 -0
- package/dist/blocks/product/pricing.js.map +1 -0
- package/dist/blocks/product/product-helpers.d.ts +22 -0
- package/dist/blocks/product/product-helpers.d.ts.map +1 -0
- package/dist/blocks/product/product-helpers.js +48 -0
- package/dist/blocks/product/product-helpers.js.map +1 -0
- package/dist/blocks/product/product-runtime.d.ts +15 -0
- package/dist/blocks/product/product-runtime.d.ts.map +1 -0
- package/dist/blocks/product/product-runtime.js +97 -0
- package/dist/blocks/product/product-runtime.js.map +1 -0
- package/dist/blocks/product/product-styles.d.ts +14 -0
- package/dist/blocks/product/product-styles.d.ts.map +1 -0
- package/dist/blocks/product/product-styles.js +120 -0
- package/dist/blocks/product/product-styles.js.map +1 -0
- package/dist/blocks/product/testimonial.d.ts +8 -0
- package/dist/blocks/product/testimonial.d.ts.map +1 -0
- package/dist/blocks/product/testimonial.js +67 -0
- package/dist/blocks/product/testimonial.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +193 -39
- package/dist/cli.js.map +1 -1
- package/dist/data/data-json-schema.d.ts +9 -0
- package/dist/data/data-json-schema.d.ts.map +1 -0
- package/dist/data/data-json-schema.js +48 -0
- package/dist/data/data-json-schema.js.map +1 -0
- package/dist/data/dataset-types.d.ts +47 -0
- package/dist/data/dataset-types.d.ts.map +1 -0
- package/dist/data/dataset-types.js +49 -0
- package/dist/data/dataset-types.js.map +1 -0
- package/dist/data/format-value.d.ts +39 -0
- package/dist/data/format-value.d.ts.map +1 -0
- package/dist/data/format-value.js +214 -0
- package/dist/data/format-value.js.map +1 -0
- package/dist/data/resolve-block-data.d.ts +24 -0
- package/dist/data/resolve-block-data.d.ts.map +1 -0
- package/dist/data/resolve-block-data.js +190 -0
- package/dist/data/resolve-block-data.js.map +1 -0
- package/dist/data/transform-pipeline.d.ts +65 -0
- package/dist/data/transform-pipeline.d.ts.map +1 -0
- package/dist/data/transform-pipeline.js +234 -0
- package/dist/data/transform-pipeline.js.map +1 -0
- package/dist/data/validate-datasets.d.ts +22 -0
- package/dist/data/validate-datasets.d.ts.map +1 -0
- package/dist/data/validate-datasets.js +137 -0
- package/dist/data/validate-datasets.js.map +1 -0
- package/dist/diagram/adapter-markup-fit.d.ts +44 -0
- package/dist/diagram/adapter-markup-fit.d.ts.map +1 -0
- package/dist/diagram/adapter-markup-fit.js +292 -0
- package/dist/diagram/adapter-markup-fit.js.map +1 -0
- package/dist/diagram/adapter-stylesheet-filter.d.ts +56 -0
- package/dist/diagram/adapter-stylesheet-filter.d.ts.map +1 -0
- package/dist/diagram/adapter-stylesheet-filter.js +245 -0
- package/dist/diagram/adapter-stylesheet-filter.js.map +1 -0
- package/dist/diagram/adapter.d.ts +17 -0
- package/dist/diagram/adapter.d.ts.map +1 -1
- package/dist/diagram/adapter.js +43 -2
- package/dist/diagram/adapter.js.map +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/ir.d.ts +18 -0
- package/dist/ir.d.ts.map +1 -1
- package/dist/ir.js.map +1 -1
- package/dist/mcp/mcp-http-transport.d.ts +68 -0
- package/dist/mcp/mcp-http-transport.d.ts.map +1 -0
- package/dist/mcp/mcp-http-transport.js +140 -0
- package/dist/mcp/mcp-http-transport.js.map +1 -0
- package/dist/mcp/mcp-json-rpc-dispatch.d.ts +38 -0
- package/dist/mcp/mcp-json-rpc-dispatch.d.ts.map +1 -0
- package/dist/mcp/mcp-json-rpc-dispatch.js +98 -0
- package/dist/mcp/mcp-json-rpc-dispatch.js.map +1 -0
- package/dist/mcp/mcp-local-tools.d.ts +20 -0
- package/dist/mcp/mcp-local-tools.d.ts.map +1 -0
- package/dist/mcp/mcp-local-tools.js +58 -0
- package/dist/mcp/mcp-local-tools.js.map +1 -0
- package/dist/mcp/mcp-protocol.d.ts +79 -0
- package/dist/mcp/mcp-protocol.d.ts.map +1 -0
- package/dist/mcp/mcp-protocol.js +83 -0
- package/dist/mcp/mcp-protocol.js.map +1 -0
- package/dist/mcp/mcp-stdio-transport.d.ts +28 -0
- package/dist/mcp/mcp-stdio-transport.d.ts.map +1 -0
- package/dist/mcp/mcp-stdio-transport.js +73 -0
- package/dist/mcp/mcp-stdio-transport.js.map +1 -0
- package/dist/mcp/mcp-tool-definitions.d.ts +66 -0
- package/dist/mcp/mcp-tool-definitions.d.ts.map +1 -0
- package/dist/mcp/mcp-tool-definitions.js +246 -0
- package/dist/mcp/mcp-tool-definitions.js.map +1 -0
- package/dist/mcp-server.d.ts +10 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +9 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/recipes/index.d.ts +27 -0
- package/dist/recipes/index.d.ts.map +1 -0
- package/dist/recipes/index.js +30 -0
- package/dist/recipes/index.js.map +1 -0
- package/dist/recipes/recipes.generated.d.ts +8 -0
- package/dist/recipes/recipes.generated.d.ts.map +1 -0
- package/dist/recipes/recipes.generated.js +704 -0
- package/dist/recipes/recipes.generated.js.map +1 -0
- package/dist/registry/actions.d.ts +2 -0
- package/dist/registry/actions.d.ts.map +1 -1
- package/dist/registry/actions.js +3 -1
- package/dist/registry/actions.js.map +1 -1
- package/dist/registry/block-module.d.ts +65 -0
- package/dist/registry/block-module.d.ts.map +1 -0
- package/dist/registry/block-module.js +19 -0
- package/dist/registry/block-module.js.map +1 -0
- package/dist/registry/catalog-search.d.ts +32 -0
- package/dist/registry/catalog-search.d.ts.map +1 -0
- package/dist/registry/catalog-search.js +122 -0
- package/dist/registry/catalog-search.js.map +1 -0
- package/dist/registry/define-helpers.d.ts +89 -0
- package/dist/registry/define-helpers.d.ts.map +1 -0
- package/dist/registry/define-helpers.js +87 -0
- package/dist/registry/define-helpers.js.map +1 -0
- package/dist/registry/describe-many.d.ts +58 -0
- package/dist/registry/describe-many.d.ts.map +1 -0
- package/dist/registry/describe-many.js +156 -0
- package/dist/registry/describe-many.js.map +1 -0
- package/dist/registry/prop-schema.d.ts +32 -1
- package/dist/registry/prop-schema.d.ts.map +1 -1
- package/dist/registry/prop-schema.js +108 -2
- package/dist/registry/prop-schema.js.map +1 -1
- package/dist/registry/registry-builder.d.ts +17 -0
- package/dist/registry/registry-builder.d.ts.map +1 -0
- package/dist/registry/registry-builder.js +158 -0
- package/dist/registry/registry-builder.js.map +1 -0
- package/dist/registry/registry.d.ts +32 -5
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +67 -14
- package/dist/registry/registry.js.map +1 -1
- package/dist/registry/roster.d.ts +34 -5
- package/dist/registry/roster.d.ts.map +1 -1
- package/dist/registry/roster.js +360 -184
- package/dist/registry/roster.js.map +1 -1
- package/dist/render/block-helpers.d.ts +45 -0
- package/dist/render/block-helpers.d.ts.map +1 -0
- package/dist/render/block-helpers.js +83 -0
- package/dist/render/block-helpers.js.map +1 -0
- package/dist/render/blocks.d.ts +10 -35
- package/dist/render/blocks.d.ts.map +1 -1
- package/dist/render/blocks.js +144 -263
- package/dist/render/blocks.js.map +1 -1
- package/dist/render/chart-figure-encoded.d.ts +11 -0
- package/dist/render/chart-figure-encoded.d.ts.map +1 -0
- package/dist/render/chart-figure-encoded.js +81 -0
- package/dist/render/chart-figure-encoded.js.map +1 -0
- package/dist/render/chart-kinds-cartesian.d.ts +14 -0
- package/dist/render/chart-kinds-cartesian.d.ts.map +1 -0
- package/dist/render/chart-kinds-cartesian.js +122 -0
- package/dist/render/chart-kinds-cartesian.js.map +1 -0
- package/dist/render/chart-kinds-composite.d.ts +16 -0
- package/dist/render/chart-kinds-composite.d.ts.map +1 -0
- package/dist/render/chart-kinds-composite.js +144 -0
- package/dist/render/chart-kinds-composite.js.map +1 -0
- package/dist/render/chart-kinds-gauge-treemap.d.ts +8 -0
- package/dist/render/chart-kinds-gauge-treemap.d.ts.map +1 -0
- package/dist/render/chart-kinds-gauge-treemap.js +101 -0
- package/dist/render/chart-kinds-gauge-treemap.js.map +1 -0
- package/dist/render/chart-kinds-histogram-waterfall.d.ts +17 -0
- package/dist/render/chart-kinds-histogram-waterfall.d.ts.map +1 -0
- package/dist/render/chart-kinds-histogram-waterfall.js +172 -0
- package/dist/render/chart-kinds-histogram-waterfall.js.map +1 -0
- package/dist/render/chart-overlays.d.ts +18 -0
- package/dist/render/chart-overlays.d.ts.map +1 -0
- package/dist/render/chart-overlays.js +58 -0
- package/dist/render/chart-overlays.js.map +1 -0
- package/dist/render/chart-scales.d.ts +83 -0
- package/dist/render/chart-scales.d.ts.map +1 -0
- package/dist/render/chart-scales.js +166 -0
- package/dist/render/chart-scales.js.map +1 -0
- package/dist/render/chart-svg-parts.d.ts +50 -0
- package/dist/render/chart-svg-parts.d.ts.map +1 -0
- package/dist/render/chart-svg-parts.js +125 -0
- package/dist/render/chart-svg-parts.js.map +1 -0
- package/dist/render/chart-text.d.ts +18 -0
- package/dist/render/chart-text.d.ts.map +1 -0
- package/dist/render/chart-text.js +69 -0
- package/dist/render/chart-text.js.map +1 -0
- package/dist/render/chart-treemap-layout.d.ts +17 -0
- package/dist/render/chart-treemap-layout.d.ts.map +1 -0
- package/dist/render/chart-treemap-layout.js +74 -0
- package/dist/render/chart-treemap-layout.js.map +1 -0
- package/dist/render/chart-types.d.ts +107 -0
- package/dist/render/chart-types.d.ts.map +1 -0
- package/dist/render/chart-types.js +11 -0
- package/dist/render/chart-types.js.map +1 -0
- package/dist/render/charts.d.ts +33 -11
- package/dist/render/charts.d.ts.map +1 -1
- package/dist/render/charts.js +145 -109
- package/dist/render/charts.js.map +1 -1
- package/dist/render/derived-variables.d.ts +37 -0
- package/dist/render/derived-variables.d.ts.map +1 -0
- package/dist/render/derived-variables.js +40 -0
- package/dist/render/derived-variables.js.map +1 -0
- package/dist/render/diagram-fallback.d.ts +25 -0
- package/dist/render/diagram-fallback.d.ts.map +1 -0
- package/dist/render/diagram-fallback.js +86 -0
- package/dist/render/diagram-fallback.js.map +1 -0
- package/dist/render/document.d.ts +15 -0
- package/dist/render/document.d.ts.map +1 -1
- package/dist/render/document.js +53 -8
- package/dist/render/document.js.map +1 -1
- package/dist/render/effects-styles.d.ts +14 -0
- package/dist/render/effects-styles.d.ts.map +1 -0
- package/dist/render/effects-styles.js +39 -0
- package/dist/render/effects-styles.js.map +1 -0
- package/dist/render/embedded-fonts.generated.d.ts +22 -0
- package/dist/render/embedded-fonts.generated.d.ts.map +1 -0
- package/dist/render/embedded-fonts.generated.js +59 -0
- package/dist/render/embedded-fonts.generated.js.map +1 -0
- package/dist/render/escape.d.ts +10 -0
- package/dist/render/escape.d.ts.map +1 -1
- package/dist/render/escape.js +28 -0
- package/dist/render/escape.js.map +1 -1
- package/dist/render/feature-styles.d.ts +14 -0
- package/dist/render/feature-styles.d.ts.map +1 -0
- package/dist/render/feature-styles.js +123 -0
- package/dist/render/feature-styles.js.map +1 -0
- package/dist/render/font-faces.d.ts +22 -0
- package/dist/render/font-faces.d.ts.map +1 -0
- package/dist/render/font-faces.js +60 -0
- package/dist/render/font-faces.js.map +1 -0
- package/dist/render/outline.d.ts +21 -0
- package/dist/render/outline.d.ts.map +1 -0
- package/dist/render/outline.js +47 -0
- package/dist/render/outline.js.map +1 -0
- package/dist/render/recipe-styles.d.ts +26 -0
- package/dist/render/recipe-styles.d.ts.map +1 -0
- package/dist/render/recipe-styles.js +218 -0
- package/dist/render/recipe-styles.js.map +1 -0
- package/dist/render/render-context.d.ts +40 -0
- package/dist/render/render-context.d.ts.map +1 -0
- package/dist/render/render-context.js +16 -0
- package/dist/render/render-context.js.map +1 -0
- package/dist/render/render.d.ts +7 -0
- package/dist/render/render.d.ts.map +1 -1
- package/dist/render/render.js +108 -41
- package/dist/render/render.js.map +1 -1
- package/dist/render/runtime.d.ts +4 -1
- package/dist/render/runtime.d.ts.map +1 -1
- package/dist/render/runtime.js +275 -128
- package/dist/render/runtime.js.map +1 -1
- package/dist/render/showcase-blocks.d.ts +52 -0
- package/dist/render/showcase-blocks.d.ts.map +1 -0
- package/dist/render/showcase-blocks.js +329 -0
- package/dist/render/showcase-blocks.js.map +1 -0
- package/dist/render/showcase-styles.d.ts +15 -0
- package/dist/render/showcase-styles.d.ts.map +1 -0
- package/dist/render/showcase-styles.js +201 -0
- package/dist/render/showcase-styles.js.map +1 -0
- package/dist/render/signature-styles.d.ts +18 -0
- package/dist/render/signature-styles.d.ts.map +1 -0
- package/dist/render/signature-styles.js +41 -0
- package/dist/render/signature-styles.js.map +1 -0
- package/dist/render/style-units.d.ts +17 -0
- package/dist/render/style-units.d.ts.map +1 -0
- package/dist/render/style-units.js +24 -0
- package/dist/render/style-units.js.map +1 -0
- package/dist/render/styles.d.ts +18 -9
- package/dist/render/styles.d.ts.map +1 -1
- package/dist/render/styles.js +228 -129
- package/dist/render/styles.js.map +1 -1
- package/dist/render/surface-styles.d.ts +24 -0
- package/dist/render/surface-styles.d.ts.map +1 -0
- package/dist/render/surface-styles.js +41 -0
- package/dist/render/surface-styles.js.map +1 -0
- package/dist/render/tone.d.ts +14 -0
- package/dist/render/tone.d.ts.map +1 -0
- package/dist/render/tone.js +40 -0
- package/dist/render/tone.js.map +1 -0
- package/dist/render/verify.d.ts +3 -0
- package/dist/render/verify.d.ts.map +1 -1
- package/dist/render/verify.js +45 -2
- package/dist/render/verify.js.map +1 -1
- package/dist/spec/asset-references.d.ts +35 -0
- package/dist/spec/asset-references.d.ts.map +1 -0
- package/dist/spec/asset-references.js +93 -0
- package/dist/spec/asset-references.js.map +1 -0
- package/dist/spec/bounds.d.ts +6 -0
- package/dist/spec/bounds.d.ts.map +1 -1
- package/dist/spec/bounds.js +7 -0
- package/dist/spec/bounds.js.map +1 -1
- package/dist/spec/conditions.d.ts +43 -0
- package/dist/spec/conditions.d.ts.map +1 -0
- package/dist/spec/conditions.js +179 -0
- package/dist/spec/conditions.js.map +1 -0
- package/dist/spec/network-policy.d.ts +33 -0
- package/dist/spec/network-policy.d.ts.map +1 -0
- package/dist/spec/network-policy.js +57 -0
- package/dist/spec/network-policy.js.map +1 -0
- package/dist/spec/normalize.d.ts +7 -2
- package/dist/spec/normalize.d.ts.map +1 -1
- package/dist/spec/normalize.js +219 -41
- package/dist/spec/normalize.js.map +1 -1
- package/dist/theme/dialect-presets.d.ts +12 -0
- package/dist/theme/dialect-presets.d.ts.map +1 -0
- package/dist/theme/dialect-presets.js +214 -0
- package/dist/theme/dialect-presets.js.map +1 -0
- package/dist/theme/load-theme.d.ts +11 -3
- package/dist/theme/load-theme.d.ts.map +1 -1
- package/dist/theme/load-theme.js +71 -12
- package/dist/theme/load-theme.js.map +1 -1
- package/dist/theme/preset-builder.d.ts +36 -0
- package/dist/theme/preset-builder.d.ts.map +1 -0
- package/dist/theme/preset-builder.js +51 -0
- package/dist/theme/preset-builder.js.map +1 -0
- package/dist/theme/presets.d.ts +8 -10
- package/dist/theme/presets.d.ts.map +1 -1
- package/dist/theme/presets.js +40 -56
- package/dist/theme/presets.js.map +1 -1
- package/dist/theme/recipes.d.ts +38 -0
- package/dist/theme/recipes.d.ts.map +1 -0
- package/dist/theme/recipes.js +96 -0
- package/dist/theme/recipes.js.map +1 -0
- package/dist/theme/theme-catalog.d.ts.map +1 -1
- package/dist/theme/theme-catalog.js +16 -0
- package/dist/theme/theme-catalog.js.map +1 -1
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +4 -4
- package/dist/theme/tokens.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/llms.txt +29 -0
- package/package.json +13 -3
package/dist/render/runtime.d.ts
CHANGED
|
@@ -11,15 +11,18 @@
|
|
|
11
11
|
* template literals) so the emitted artifact does not depend on a build step or
|
|
12
12
|
* a modern-browser-only syntax tier.
|
|
13
13
|
*/
|
|
14
|
+
import type { FeatureModule } from '../registry/block-module.js';
|
|
14
15
|
import type { RuntimeFeature } from '../registry/roster.js';
|
|
15
16
|
export interface RuntimeOptions {
|
|
16
17
|
features: ReadonlySet<RuntimeFeature>;
|
|
17
18
|
state: Record<string, unknown>;
|
|
18
19
|
/** True when at least one block declares an action binding. */
|
|
19
20
|
hasBindings: boolean;
|
|
21
|
+
/** Registry features the page uses, in registry order. */
|
|
22
|
+
moduleFeatures?: readonly FeatureModule[];
|
|
20
23
|
}
|
|
21
24
|
/** Build the emitted runtime for the features a page actually uses. */
|
|
22
25
|
export declare function buildRuntime(options: RuntimeOptions): string;
|
|
23
26
|
/** Features whose presence requires the live region in the document. */
|
|
24
|
-
export declare function needsLiveRegion(features: ReadonlySet<RuntimeFeature
|
|
27
|
+
export declare function needsLiveRegion(features: ReadonlySet<RuntimeFeature>, moduleFeatures?: readonly FeatureModule[]): boolean;
|
|
25
28
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/render/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/render/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM5D,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,+DAA+D;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CAC3C;AAugBD,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAsD5D;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,WAAW,CAAC,cAAc,CAAC,EACrC,cAAc,GAAE,SAAS,aAAa,EAAO,GAC5C,OAAO,CAKT"}
|
package/dist/render/runtime.js
CHANGED
|
@@ -11,12 +11,18 @@
|
|
|
11
11
|
* template literals) so the emitted artifact does not depend on a build step or
|
|
12
12
|
* a modern-browser-only syntax tier.
|
|
13
13
|
*/
|
|
14
|
+
import { CAROUSEL, TABS } from '../blocks/composition/composition-runtime.js';
|
|
15
|
+
import { serializeJsonForScript } from './escape.js';
|
|
14
16
|
/** Features that produce user-facing feedback and therefore need a live region. */
|
|
15
17
|
const ANNOUNCING_FEATURES = ['copy', 'filter', 'theme'];
|
|
16
|
-
const
|
|
18
|
+
const helpers = (conditions) => `
|
|
17
19
|
function q(sel, ctx) { return (ctx || doc).querySelector(sel); }
|
|
18
20
|
function qa(sel, ctx) { return Array.prototype.slice.call((ctx || doc).querySelectorAll(sel)); }
|
|
19
21
|
function byId(id) { return qa('[data-ak-id="' + id + '"]'); }
|
|
22
|
+
function motionAllowed() {
|
|
23
|
+
if (root.getAttribute('data-motion') === 'none') return false;
|
|
24
|
+
return !(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
25
|
+
}
|
|
20
26
|
function announce(message) {
|
|
21
27
|
var region = q('[data-ak-live]');
|
|
22
28
|
if (region) region.textContent = message;
|
|
@@ -58,6 +64,46 @@ function syncBindings() {
|
|
|
58
64
|
} else {
|
|
59
65
|
el.textContent = String(value);
|
|
60
66
|
}
|
|
67
|
+
});${conditions ? '\n syncConditions();' : ''}
|
|
68
|
+
}`;
|
|
69
|
+
/**
|
|
70
|
+
* `visibleWhen`: re-evaluate every condition after a state change. The rules
|
|
71
|
+
* match `evaluateCondition` in the compiler exactly, which already emitted the
|
|
72
|
+
* initial view; own keys only, so \`state.constructor\` reads as unset.
|
|
73
|
+
*/
|
|
74
|
+
const STATE = `
|
|
75
|
+
function readOwnPath(path) {
|
|
76
|
+
var parts = String(path).split('.');
|
|
77
|
+
var cursor = state;
|
|
78
|
+
for (var i = 1; i < parts.length; i += 1) {
|
|
79
|
+
if (cursor === null || typeof cursor !== 'object' || Array.isArray(cursor)) return undefined;
|
|
80
|
+
if (!Object.prototype.hasOwnProperty.call(cursor, parts[i])) return undefined;
|
|
81
|
+
cursor = cursor[parts[i]];
|
|
82
|
+
}
|
|
83
|
+
return cursor;
|
|
84
|
+
}
|
|
85
|
+
function evalCondition(condition) {
|
|
86
|
+
var value = readOwnPath(condition.path);
|
|
87
|
+
var op = condition.op;
|
|
88
|
+
if (op === 'equals') return value === condition.value;
|
|
89
|
+
if (op === 'notEquals') return value !== condition.value;
|
|
90
|
+
if (op === 'in' || op === 'notIn') {
|
|
91
|
+
var found = false;
|
|
92
|
+
for (var i = 0; i < condition.value.length; i += 1) {
|
|
93
|
+
if (condition.value[i] === value) found = true;
|
|
94
|
+
}
|
|
95
|
+
return op === 'in' ? found : !found;
|
|
96
|
+
}
|
|
97
|
+
if (op === 'truthy') return Boolean(value);
|
|
98
|
+
if (op === 'falsy') return !value;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
function syncConditions() {
|
|
102
|
+
qa('[data-ak-when]').forEach(function (el) {
|
|
103
|
+
var condition = readJson(el, 'data-ak-when');
|
|
104
|
+
if (!condition || typeof condition.path !== 'string') return;
|
|
105
|
+
if (evalCondition(condition)) el.removeAttribute('hidden');
|
|
106
|
+
else el.setAttribute('hidden', '');
|
|
61
107
|
});
|
|
62
108
|
}`;
|
|
63
109
|
const FIRE = `
|
|
@@ -69,6 +115,9 @@ function fire(source, eventName, detail) {
|
|
|
69
115
|
for (var i = 0; i < bindings.length; i += 1) run(bindings[i], source, detail);
|
|
70
116
|
return;
|
|
71
117
|
}
|
|
118
|
+
// A block's event belongs to that block: it never reaches an enclosing
|
|
119
|
+
// block's bindings.
|
|
120
|
+
if (target.hasAttribute('data-ak-id')) return;
|
|
72
121
|
target = target.parentElement;
|
|
73
122
|
}
|
|
74
123
|
}`;
|
|
@@ -81,7 +130,7 @@ function run(action, source, detail) {
|
|
|
81
130
|
nodes.forEach(function (node) {
|
|
82
131
|
if (node.tagName === 'DIALOG') openDialog(node);
|
|
83
132
|
else if (node.tagName === 'DETAILS') node.open = !node.open;
|
|
84
|
-
else if (node.hasAttribute('data-ak-theme-toggle')) toggleTheme();
|
|
133
|
+
else if (node.hasAttribute('data-ak-theme-toggle')) toggleTheme(node);
|
|
85
134
|
else {
|
|
86
135
|
var collapsed = node.getAttribute('aria-expanded') === 'false' || node.hasAttribute('hidden');
|
|
87
136
|
if (collapsed) { node.removeAttribute('hidden'); node.setAttribute('aria-expanded', 'true'); }
|
|
@@ -101,7 +150,7 @@ function run(action, source, detail) {
|
|
|
101
150
|
if (type === 'copy') {
|
|
102
151
|
var text = '';
|
|
103
152
|
byId(targetId).forEach(function (node) { text += node.textContent || ''; });
|
|
104
|
-
copyText(text,
|
|
153
|
+
copyText(text, source);
|
|
105
154
|
return;
|
|
106
155
|
}
|
|
107
156
|
if (type === 'download') {
|
|
@@ -116,7 +165,9 @@ function run(action, source, detail) {
|
|
|
116
165
|
return;
|
|
117
166
|
}
|
|
118
167
|
if (type === 'set-value') {
|
|
119
|
-
|
|
168
|
+
// An action without its own value takes the event's, such as a slider's.
|
|
169
|
+
var next = Object.prototype.hasOwnProperty.call(action, 'value') ? action.value : (detail ? detail.value : undefined);
|
|
170
|
+
if (next !== undefined) setPath(action.path, next);
|
|
120
171
|
return;
|
|
121
172
|
}
|
|
122
173
|
if (type === 'next' || type === 'previous') {
|
|
@@ -151,23 +202,59 @@ function applyTheme(mode) {
|
|
|
151
202
|
root.setAttribute('data-theme', next);
|
|
152
203
|
}
|
|
153
204
|
try { window.localStorage.setItem('ak-render-theme', mode === 'system' ? 'system' : next); } catch (error) {}
|
|
205
|
+
syncThemeToggles(next);
|
|
206
|
+
announce('Theme set to ' + next);
|
|
207
|
+
}
|
|
208
|
+
// The toggle names the scheme it switches to, so it must follow the scheme in
|
|
209
|
+
// effect, including one the system chose before anything was stored.
|
|
210
|
+
function syncThemeToggles(scheme) {
|
|
154
211
|
qa('[data-ak-theme-toggle]').forEach(function (button) {
|
|
155
|
-
button.setAttribute('aria-pressed', String(
|
|
156
|
-
button.textContent =
|
|
212
|
+
button.setAttribute('aria-pressed', String(scheme === 'dark'));
|
|
213
|
+
button.textContent = scheme === 'dark' ? 'Light' : 'Dark';
|
|
157
214
|
});
|
|
158
|
-
announce('Theme set to ' + next);
|
|
159
215
|
}
|
|
160
|
-
|
|
216
|
+
/*
|
|
217
|
+
* Where supported, the new scheme is revealed as a circle growing from the
|
|
218
|
+
* toggle. The origin is written to two custom properties; the stylesheet owns
|
|
219
|
+
* the animation, and reduced motion or an older engine switches instantly.
|
|
220
|
+
*/
|
|
221
|
+
function toggleTheme(source) {
|
|
222
|
+
if (!motionAllowed() || typeof doc.startViewTransition !== 'function') { applyTheme('toggle'); return; }
|
|
223
|
+
if (source && source.getBoundingClientRect) {
|
|
224
|
+
var box = source.getBoundingClientRect();
|
|
225
|
+
root.style.setProperty('--ak-vt-x', Math.round(box.left + box.width / 2) + 'px');
|
|
226
|
+
root.style.setProperty('--ak-vt-y', Math.round(box.top + box.height / 2) + 'px');
|
|
227
|
+
}
|
|
228
|
+
doc.startViewTransition(function () { applyTheme('toggle'); });
|
|
229
|
+
}
|
|
161
230
|
function restoreTheme() {
|
|
231
|
+
// While the system owns the scheme, a change in system settings must relabel
|
|
232
|
+
// the toggle too, not only the first paint.
|
|
233
|
+
var system = window.matchMedia('(prefers-color-scheme: dark)');
|
|
234
|
+
if (typeof system.addEventListener === 'function') {
|
|
235
|
+
system.addEventListener('change', function () {
|
|
236
|
+
if (!root.getAttribute('data-theme')) syncThemeToggles(system.matches ? 'dark' : 'light');
|
|
237
|
+
});
|
|
238
|
+
}
|
|
162
239
|
var stored = null;
|
|
163
240
|
try { stored = window.localStorage.getItem('ak-render-theme'); } catch (error) {}
|
|
164
|
-
if (!stored)
|
|
241
|
+
if (!stored) {
|
|
242
|
+
syncThemeToggles(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
165
245
|
if (stored === 'system') applyTheme('system');
|
|
166
246
|
else applyTheme(stored);
|
|
167
247
|
}`;
|
|
168
248
|
const COPY = `
|
|
169
|
-
function copyText(text,
|
|
170
|
-
var done = function () {
|
|
249
|
+
function copyText(text, source) {
|
|
250
|
+
var done = function () {
|
|
251
|
+
announce('Copied to clipboard');
|
|
252
|
+
// A visible confirmation on the control itself, cleared after a moment.
|
|
253
|
+
if (source && source.setAttribute) {
|
|
254
|
+
source.setAttribute('data-ak-copied', '');
|
|
255
|
+
window.setTimeout(function () { source.removeAttribute('data-ak-copied'); }, 1600);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
171
258
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
172
259
|
navigator.clipboard.writeText(text).then(done, function () { fallbackCopy(text, done); });
|
|
173
260
|
} else {
|
|
@@ -198,6 +285,149 @@ function downloadText(text, filename, source) {
|
|
|
198
285
|
window.setTimeout(function () { URL.revokeObjectURL(url); }, 0);
|
|
199
286
|
announce('Downloaded ' + safeName);
|
|
200
287
|
}`;
|
|
288
|
+
/**
|
|
289
|
+
* Print a diagram's folded text description. The print stylesheet opens it
|
|
290
|
+
* through \`::details-content\`; where that selector is unsupported, the runtime
|
|
291
|
+
* opens each closed description for the print and closes it again afterwards.
|
|
292
|
+
*/
|
|
293
|
+
const DIAGRAM = `
|
|
294
|
+
function wireDiagramPrint() {
|
|
295
|
+
var opened = [];
|
|
296
|
+
window.addEventListener('beforeprint', function () {
|
|
297
|
+
qa('details.ak-diagram-details:not([open])').forEach(function (details) {
|
|
298
|
+
details.open = true;
|
|
299
|
+
opened.push(details);
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
window.addEventListener('afterprint', function () {
|
|
303
|
+
opened.forEach(function (details) { details.open = false; });
|
|
304
|
+
opened = [];
|
|
305
|
+
});
|
|
306
|
+
}`;
|
|
307
|
+
const OUTLINE = `
|
|
308
|
+
function wireOutline() {
|
|
309
|
+
var links = qa('[data-ak-outline-link]');
|
|
310
|
+
if (!links.length || typeof window.IntersectionObserver !== 'function') return;
|
|
311
|
+
var byAnchor = {};
|
|
312
|
+
links.forEach(function (link) { byAnchor[link.getAttribute('href').slice(1)] = link; });
|
|
313
|
+
var mark = function (id) {
|
|
314
|
+
links.forEach(function (link) {
|
|
315
|
+
if (link === byAnchor[id]) link.setAttribute('aria-current', 'location');
|
|
316
|
+
else link.removeAttribute('aria-current');
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
// The current section is the last one whose top has crossed the upper third
|
|
320
|
+
// of the viewport, which matches where a reader's eye rests.
|
|
321
|
+
var observer = new window.IntersectionObserver(function (entries) {
|
|
322
|
+
entries.forEach(function (entry) { if (entry.isIntersecting) mark(entry.target.id); });
|
|
323
|
+
}, { rootMargin: '0px 0px -66% 0px' });
|
|
324
|
+
Object.keys(byAnchor).forEach(function (id) {
|
|
325
|
+
var section = doc.getElementById(id);
|
|
326
|
+
if (section) observer.observe(section);
|
|
327
|
+
});
|
|
328
|
+
}`;
|
|
329
|
+
const BEFORE_AFTER = `
|
|
330
|
+
function wireBeforeAfter() {
|
|
331
|
+
qa('[data-ak-before-after]').forEach(function (figure) {
|
|
332
|
+
var stage = q('.ak-ba-stage', figure);
|
|
333
|
+
var input = q('.ak-ba-range', figure);
|
|
334
|
+
if (!stage || !input) return;
|
|
335
|
+
var apply = function () { stage.style.setProperty('--ak-split', input.value + '%'); };
|
|
336
|
+
// Dragging anywhere on the stage moves the divider, which a bare range input
|
|
337
|
+
// only does from its thumb on some touch browsers.
|
|
338
|
+
var dragging = false;
|
|
339
|
+
var follow = function (event) {
|
|
340
|
+
var box = stage.getBoundingClientRect();
|
|
341
|
+
if (!box.width) return;
|
|
342
|
+
var ratio = Math.min(Math.max((event.clientX - box.left) / box.width, 0), 1);
|
|
343
|
+
input.value = String(Math.round(ratio * 100));
|
|
344
|
+
apply();
|
|
345
|
+
};
|
|
346
|
+
input.addEventListener('input', apply, false);
|
|
347
|
+
input.addEventListener('pointerdown', function (event) {
|
|
348
|
+
dragging = true;
|
|
349
|
+
if (input.setPointerCapture) input.setPointerCapture(event.pointerId);
|
|
350
|
+
follow(event);
|
|
351
|
+
}, false);
|
|
352
|
+
input.addEventListener('pointermove', function (event) { if (dragging) follow(event); }, false);
|
|
353
|
+
input.addEventListener('pointerup', function () { dragging = false; }, false);
|
|
354
|
+
input.addEventListener('pointercancel', function () { dragging = false; }, false);
|
|
355
|
+
apply();
|
|
356
|
+
figure.setAttribute('data-ak-ready', '');
|
|
357
|
+
});
|
|
358
|
+
}`;
|
|
359
|
+
const EFFECTS = `
|
|
360
|
+
function countUp(el) {
|
|
361
|
+
if (el.children.length) return;
|
|
362
|
+
var text = el.textContent;
|
|
363
|
+
var match = /^([^\\dA-Za-z]*)(\\d{1,3}(?:,\\d{3})+|\\d+)(\\.\\d+)?([^\\d]*)$/.exec(text.trim());
|
|
364
|
+
if (!match) return;
|
|
365
|
+
var grouped = match[2].indexOf(',') !== -1;
|
|
366
|
+
var places = match[3] ? match[3].length - 1 : 0;
|
|
367
|
+
var target = parseFloat(match[2].replace(/,/g, '') + (match[3] || ''));
|
|
368
|
+
if (!isFinite(target) || target === 0) return;
|
|
369
|
+
var format = function (value) {
|
|
370
|
+
var fixed = value.toFixed(places);
|
|
371
|
+
if (grouped) {
|
|
372
|
+
var parts = fixed.split('.');
|
|
373
|
+
parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');
|
|
374
|
+
fixed = parts.join('.');
|
|
375
|
+
}
|
|
376
|
+
return match[1] + fixed + match[4];
|
|
377
|
+
};
|
|
378
|
+
// The authored value stays in the DOM for assistive technology, copy and
|
|
379
|
+
// print; the rolling figure is a hidden layer drawn over it while it runs.
|
|
380
|
+
var real = doc.createElement('span');
|
|
381
|
+
real.className = 'ak-sr';
|
|
382
|
+
real.textContent = text;
|
|
383
|
+
var shown = doc.createElement('span');
|
|
384
|
+
shown.setAttribute('aria-hidden', 'true');
|
|
385
|
+
shown.textContent = format(0);
|
|
386
|
+
el.textContent = '';
|
|
387
|
+
el.appendChild(real);
|
|
388
|
+
el.appendChild(shown);
|
|
389
|
+
var settled = false;
|
|
390
|
+
var settle = function () {
|
|
391
|
+
if (settled) return;
|
|
392
|
+
settled = true;
|
|
393
|
+
el.textContent = text;
|
|
394
|
+
window.removeEventListener('beforeprint', settle);
|
|
395
|
+
};
|
|
396
|
+
window.addEventListener('beforeprint', settle);
|
|
397
|
+
var began = null;
|
|
398
|
+
var step = function (now) {
|
|
399
|
+
if (settled) return;
|
|
400
|
+
if (began === null) began = now;
|
|
401
|
+
var progress = Math.min((now - began) / 1400, 1);
|
|
402
|
+
if (progress >= 1) { settle(); return; }
|
|
403
|
+
shown.textContent = format(target * (1 - Math.pow(1 - progress, 4)));
|
|
404
|
+
window.requestAnimationFrame(step);
|
|
405
|
+
};
|
|
406
|
+
window.requestAnimationFrame(step);
|
|
407
|
+
}
|
|
408
|
+
function wireEffects() {
|
|
409
|
+
if (!motionAllowed()) return;
|
|
410
|
+
// A soft light follows the pointer across cards and tiles.
|
|
411
|
+
doc.addEventListener('pointermove', function (event) {
|
|
412
|
+
var surface = event.target && event.target.closest ? event.target.closest('.ak-card, .ak-tile, .ak-kpi-card') : null;
|
|
413
|
+
if (!surface) return;
|
|
414
|
+
var box = surface.getBoundingClientRect();
|
|
415
|
+
surface.style.setProperty('--ak-mx', Math.round(event.clientX - box.left) + 'px');
|
|
416
|
+
surface.style.setProperty('--ak-my', Math.round(event.clientY - box.top) + 'px');
|
|
417
|
+
}, { passive: true });
|
|
418
|
+
if (typeof window.IntersectionObserver !== 'function') return;
|
|
419
|
+
// Blocks play their entrance as they arrive. Until then they show their final
|
|
420
|
+
// state, so a capture, a print or a disabled script never sees them blank.
|
|
421
|
+
var observer = new window.IntersectionObserver(function (entries) {
|
|
422
|
+
entries.forEach(function (entry) {
|
|
423
|
+
if (!entry.isIntersecting) return;
|
|
424
|
+
observer.unobserve(entry.target);
|
|
425
|
+
if (entry.target.hasAttribute('data-ak-animate')) entry.target.setAttribute('data-ak-inview', '');
|
|
426
|
+
else countUp(entry.target);
|
|
427
|
+
});
|
|
428
|
+
}, { rootMargin: '0px 0px 12% 0px' });
|
|
429
|
+
qa('[data-ak-animate], [data-ak-count], .ak-stat dd').forEach(function (el) { observer.observe(el); });
|
|
430
|
+
}`;
|
|
201
431
|
const DIALOG = `
|
|
202
432
|
var lastFocus = null;
|
|
203
433
|
function openDialog(dialog) {
|
|
@@ -214,116 +444,6 @@ function closeDialog(dialog) {
|
|
|
214
444
|
if (lastFocus && typeof lastFocus.focus === 'function') lastFocus.focus();
|
|
215
445
|
fire(dialog, 'close');
|
|
216
446
|
}`;
|
|
217
|
-
const TABS = `
|
|
218
|
-
function selectTab(container, action, fireFn) {
|
|
219
|
-
var tabs = qa('[role="tab"]', container);
|
|
220
|
-
if (!tabs.length) return;
|
|
221
|
-
var index = tabs.length - 1;
|
|
222
|
-
if (typeof action.index === 'number') index = Math.min(Math.max(action.index, 0), tabs.length - 1);
|
|
223
|
-
else if (action.tabId) {
|
|
224
|
-
for (var i = 0; i < tabs.length; i += 1) if (tabs[i].getAttribute('data-ak-tab-id') === action.tabId) index = i;
|
|
225
|
-
} else {
|
|
226
|
-
var active = tabs.findIndex(function (tab) { return tab.getAttribute('aria-selected') === 'true'; });
|
|
227
|
-
if (active >= 0 && typeof action.index !== 'number' && !action.tabId) index = active;
|
|
228
|
-
}
|
|
229
|
-
activateTab(container, index, true, fireFn, true);
|
|
230
|
-
}
|
|
231
|
-
function activateTab(container, index, moveFocus, fireFn, announceChange) {
|
|
232
|
-
var tabs = qa('[role="tab"]', container);
|
|
233
|
-
qa('[role="tabpanel"]', container).forEach(function (panel, panelIndex) {
|
|
234
|
-
var selected = panelIndex === index;
|
|
235
|
-
panel.hidden = !selected;
|
|
236
|
-
panel.setAttribute('tabindex', selected ? '0' : '-1');
|
|
237
|
-
});
|
|
238
|
-
tabs.forEach(function (tab, tabIndex) {
|
|
239
|
-
var selected = tabIndex === index;
|
|
240
|
-
tab.setAttribute('aria-selected', String(selected));
|
|
241
|
-
tab.tabIndex = selected ? 0 : -1;
|
|
242
|
-
});
|
|
243
|
-
if (moveFocus && tabs[index]) tabs[index].focus();
|
|
244
|
-
// Only a user-driven change is worth announcing. Announcing the initial
|
|
245
|
-
// selection would make every page with tabs talk on load.
|
|
246
|
-
if (announceChange) announce('Tab ' + (index + 1) + ' of ' + tabs.length);
|
|
247
|
-
if (fireFn) fireFn(container, 'select', { index: index });
|
|
248
|
-
}
|
|
249
|
-
function wireTabs() {
|
|
250
|
-
qa('[data-ak-tabs]').forEach(function (container) {
|
|
251
|
-
activateTab(container, 0, false, fire, false);
|
|
252
|
-
qa('[role="tab"]', container).forEach(function (tab, index) {
|
|
253
|
-
tab.addEventListener('click', function () { selectTab(container, { index: index }, fire); }, false);
|
|
254
|
-
tab.addEventListener('keydown', function (event) {
|
|
255
|
-
var keys = ['ArrowRight', 'ArrowLeft', 'Home', 'End'];
|
|
256
|
-
if (keys.indexOf(event.key) === -1) return;
|
|
257
|
-
event.preventDefault();
|
|
258
|
-
var total = qa('[role="tab"]', container).length;
|
|
259
|
-
var current = index;
|
|
260
|
-
if (event.key === 'ArrowRight') current = (index + 1) % total;
|
|
261
|
-
else if (event.key === 'ArrowLeft') current = (index - 1 + total) % total;
|
|
262
|
-
else if (event.key === 'Home') current = 0;
|
|
263
|
-
else current = total - 1;
|
|
264
|
-
activateTab(container, current, true, fire, true);
|
|
265
|
-
}, false);
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
}`;
|
|
269
|
-
const CAROUSEL = `
|
|
270
|
-
function shiftSlide(carousel, delta, fireFn) {
|
|
271
|
-
var slides = qa('[data-ak-slide]', carousel);
|
|
272
|
-
if (!slides.length) return;
|
|
273
|
-
var current = slides.findIndex(function (slide) { return !slide.hidden; });
|
|
274
|
-
if (current < 0) current = 0;
|
|
275
|
-
var next = (current + delta + slides.length) % slides.length;
|
|
276
|
-
showSlide(carousel, next, fireFn, false);
|
|
277
|
-
}
|
|
278
|
-
function showSlide(carousel, index, fireFn, focus) {
|
|
279
|
-
var slides = qa('[data-ak-slide]', carousel);
|
|
280
|
-
if (!slides.length) return;
|
|
281
|
-
var bounded = Math.min(Math.max(index, 0), slides.length - 1);
|
|
282
|
-
slides.forEach(function (slide, slideIndex) {
|
|
283
|
-
var active = slideIndex === bounded;
|
|
284
|
-
slide.hidden = !active;
|
|
285
|
-
slide.setAttribute('aria-hidden', String(!active));
|
|
286
|
-
});
|
|
287
|
-
var buttons = qa('[data-ak-carousel]', carousel);
|
|
288
|
-
buttons.forEach(function (button) {
|
|
289
|
-
var isPrev = button.getAttribute('data-ak-carousel') === 'prev';
|
|
290
|
-
button.disabled = !carousel.hasAttribute('data-ak-loop') && ((isPrev && bounded === 0) || (!isPrev && bounded === slides.length - 1));
|
|
291
|
-
});
|
|
292
|
-
var status = q('[data-ak-carousel-status]', carousel);
|
|
293
|
-
if (status) status.textContent = (bounded + 1) + ' / ' + slides.length;
|
|
294
|
-
if (focus && slides[bounded]) slides[bounded].focus();
|
|
295
|
-
if (fireFn) fireFn(carousel, 'change', { index: bounded });
|
|
296
|
-
}
|
|
297
|
-
function wireCarousels() {
|
|
298
|
-
qa('[data-ak-carousel-root]').forEach(function (carousel) {
|
|
299
|
-
showSlide(carousel, 0, fire, false);
|
|
300
|
-
qa('[data-ak-carousel]', carousel).forEach(function (button) {
|
|
301
|
-
button.addEventListener('click', function () {
|
|
302
|
-
shiftSlide(carousel, button.getAttribute('data-ak-carousel') === 'next' ? 1 : -1, fire);
|
|
303
|
-
}, false);
|
|
304
|
-
});
|
|
305
|
-
carousel.addEventListener('keydown', function (event) {
|
|
306
|
-
if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;
|
|
307
|
-
event.preventDefault();
|
|
308
|
-
var delta = event.key === 'ArrowRight' ? 1 : -1;
|
|
309
|
-
var slides = qa('[data-ak-slide]', carousel);
|
|
310
|
-
var current = slides.findIndex(function (slide) { return !slide.hidden; });
|
|
311
|
-
showSlide(carousel, current + delta, fire, true);
|
|
312
|
-
}, false);
|
|
313
|
-
var startX = null;
|
|
314
|
-
carousel.addEventListener('touchstart', function (event) {
|
|
315
|
-
if (event.touches.length === 1) startX = event.touches[0].clientX;
|
|
316
|
-
}, { passive: true });
|
|
317
|
-
carousel.addEventListener('touchend', function (event) {
|
|
318
|
-
if (startX === null) return;
|
|
319
|
-
var endX = event.changedTouches.length ? event.changedTouches[0].clientX : startX;
|
|
320
|
-
var delta = endX - startX;
|
|
321
|
-
startX = null;
|
|
322
|
-
if (Math.abs(delta) < 40) return;
|
|
323
|
-
shiftSlide(carousel, delta < 0 ? 1 : -1, fire);
|
|
324
|
-
}, false);
|
|
325
|
-
});
|
|
326
|
-
}`;
|
|
327
447
|
const SLIDER = `
|
|
328
448
|
function wireSliders() {
|
|
329
449
|
qa('[data-ak-slider]').forEach(function (input) {
|
|
@@ -383,7 +503,7 @@ doc.addEventListener('click', function (event) {
|
|
|
383
503
|
return;
|
|
384
504
|
}
|
|
385
505
|
if (target.hasAttribute && target.hasAttribute('data-ak-theme-toggle')) {
|
|
386
|
-
toggleTheme();
|
|
506
|
+
toggleTheme(target);
|
|
387
507
|
return;
|
|
388
508
|
}
|
|
389
509
|
target = target.parentElement;
|
|
@@ -400,8 +520,11 @@ restoreTheme();`;
|
|
|
400
520
|
/** Build the emitted runtime for the features a page actually uses. */
|
|
401
521
|
export function buildRuntime(options) {
|
|
402
522
|
const { features } = options;
|
|
403
|
-
const
|
|
523
|
+
const modules = options.moduleFeatures ?? [];
|
|
524
|
+
const conditions = features.has('state');
|
|
404
525
|
const parts = [];
|
|
526
|
+
if (conditions)
|
|
527
|
+
parts.push(STATE);
|
|
405
528
|
if (features.has('theme'))
|
|
406
529
|
parts.push(THEME);
|
|
407
530
|
if (features.has('copy'))
|
|
@@ -416,6 +539,17 @@ export function buildRuntime(options) {
|
|
|
416
539
|
parts.push(SLIDER);
|
|
417
540
|
if (features.has('tabs'))
|
|
418
541
|
parts.push(TABS);
|
|
542
|
+
if (features.has('outline'))
|
|
543
|
+
parts.push(OUTLINE);
|
|
544
|
+
if (features.has('before-after'))
|
|
545
|
+
parts.push(BEFORE_AFTER);
|
|
546
|
+
if (features.has('diagram'))
|
|
547
|
+
parts.push(DIAGRAM);
|
|
548
|
+
for (const feature of modules) {
|
|
549
|
+
if (feature.script !== undefined)
|
|
550
|
+
parts.push(feature.script.code);
|
|
551
|
+
}
|
|
552
|
+
parts.push(EFFECTS);
|
|
419
553
|
const wiring = [];
|
|
420
554
|
if (features.has('tabs'))
|
|
421
555
|
wiring.push('wireTabs();');
|
|
@@ -425,27 +559,40 @@ export function buildRuntime(options) {
|
|
|
425
559
|
wiring.push('wireSliders();');
|
|
426
560
|
if (features.has('filter'))
|
|
427
561
|
wiring.push('wireFilters();');
|
|
562
|
+
if (features.has('outline'))
|
|
563
|
+
wiring.push('wireOutline();');
|
|
564
|
+
if (features.has('before-after'))
|
|
565
|
+
wiring.push('wireBeforeAfter();');
|
|
566
|
+
if (features.has('diagram'))
|
|
567
|
+
wiring.push('wireDiagramPrint();');
|
|
568
|
+
for (const feature of modules) {
|
|
569
|
+
if (feature.script?.boot !== undefined)
|
|
570
|
+
wiring.push(feature.script.boot);
|
|
571
|
+
}
|
|
572
|
+
wiring.push('wireEffects();');
|
|
428
573
|
return [
|
|
429
574
|
'(function () {',
|
|
430
575
|
'"use strict";',
|
|
431
576
|
'var doc = document;',
|
|
432
577
|
'var root = doc.documentElement;',
|
|
433
|
-
|
|
434
|
-
|
|
578
|
+
// The state is author data inside a script element: escaped so a value such
|
|
579
|
+
// as `</script>` cannot close it.
|
|
580
|
+
`var state = ${serializeJsonForScript(options.state)};`,
|
|
581
|
+
helpers(conditions),
|
|
435
582
|
RUN,
|
|
436
583
|
FIRE,
|
|
437
584
|
...parts,
|
|
438
585
|
DELEGATION,
|
|
439
586
|
BOOT,
|
|
440
587
|
...wiring,
|
|
441
|
-
needsLiveRegion ? '' : '',
|
|
442
588
|
'})();',
|
|
443
589
|
]
|
|
444
590
|
.filter((part) => part !== '')
|
|
445
591
|
.join('\n');
|
|
446
592
|
}
|
|
447
593
|
/** Features whose presence requires the live region in the document. */
|
|
448
|
-
export function needsLiveRegion(features) {
|
|
449
|
-
return ANNOUNCING_FEATURES.some((feature) => features.has(feature))
|
|
594
|
+
export function needsLiveRegion(features, moduleFeatures = []) {
|
|
595
|
+
return (ANNOUNCING_FEATURES.some((feature) => features.has(feature)) ||
|
|
596
|
+
moduleFeatures.some((feature) => feature.announces === true && features.has(feature.name)));
|
|
450
597
|
}
|
|
451
598
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/render/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/render/runtime.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Showcase block renderers.
|
|
3
|
+
*
|
|
4
|
+
* Blocks that present work rather than structure it: a bento mosaic, a ticker,
|
|
5
|
+
* a terminal session, a file tree, a before/after slider, KPI cards with
|
|
6
|
+
* sparklines, a framed feature spotlight, and a checklist.
|
|
7
|
+
*
|
|
8
|
+
* The same rules as `blocks.ts` apply: pure functions of the node and the IR,
|
|
9
|
+
* exactly one `data-ak-id` per block, no style attributes or handlers. Every
|
|
10
|
+
* motion these blocks get comes from CSS or the runtime, and the markup is
|
|
11
|
+
* complete without either, so the content reads the same in a PDF, a
|
|
12
|
+
* screenshot, or with script disabled.
|
|
13
|
+
*/
|
|
14
|
+
import type { IrNode, NetworkPolicy } from '../ir.js';
|
|
15
|
+
import { type JsonValue } from '../json.js';
|
|
16
|
+
/** Minimal render context the showcase renderers need. */
|
|
17
|
+
export interface ShowcaseContext {
|
|
18
|
+
ir: {
|
|
19
|
+
policy: {
|
|
20
|
+
network: NetworkPolicy;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
type ShowcaseRenderer = (node: IrNode, context: ShowcaseContext) => string;
|
|
25
|
+
/** An image allowed by the policy, or an honest note when it is not. */
|
|
26
|
+
export declare function framedImage(source: string, alt: string, policy: NetworkPolicy, loading?: 'lazy' | 'eager'): string;
|
|
27
|
+
/** Browser chrome (decorative) around an image: the bar, then the viewport. */
|
|
28
|
+
export declare function browserShot(source: string, alt: string, address: string, policy: NetworkPolicy, loading?: 'lazy' | 'eager'): string;
|
|
29
|
+
export declare function paragraph(className: string, text: string): string;
|
|
30
|
+
/** A paragraph of prose: backtick spans become inline code. */
|
|
31
|
+
export declare function prose(className: string, text: string): string;
|
|
32
|
+
interface TreeFile {
|
|
33
|
+
name: string;
|
|
34
|
+
status: string;
|
|
35
|
+
note: string;
|
|
36
|
+
}
|
|
37
|
+
interface TreeDir {
|
|
38
|
+
name: string;
|
|
39
|
+
dirs: Map<string, TreeDir>;
|
|
40
|
+
files: TreeFile[];
|
|
41
|
+
}
|
|
42
|
+
/** Build a folder tree from slash-separated paths; a trailing slash names an empty folder. */
|
|
43
|
+
export declare function buildFileTree(items: Record<string, JsonValue>[]): TreeDir;
|
|
44
|
+
/** Line and area paths for a sparkline, scaled into a fixed view box. */
|
|
45
|
+
export declare function sparkPaths(series: number[]): {
|
|
46
|
+
line: string;
|
|
47
|
+
area: string;
|
|
48
|
+
end: [number, number];
|
|
49
|
+
};
|
|
50
|
+
export declare const SHOWCASE_RENDERERS: Record<string, ShowcaseRenderer>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=showcase-blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showcase-blocks.d.ts","sourceRoot":"","sources":["../../src/render/showcase-blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAuB3D,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE;QAAE,MAAM,EAAE;YAAE,OAAO,EAAE,aAAa,CAAA;SAAE,CAAA;KAAE,CAAC;CAC5C;AAED,KAAK,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,KAAK,MAAM,CAAC;AAE3E,wEAAwE;AACxE,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,MAAM,GAAG,OAAgB,GACjC,MAAM,CAUR;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,MAAM,GAAG,OAAgB,GACjC,MAAM,CAKR;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,+DAA+D;AAC/D,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D;AAqDD,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,OAAO;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3B,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAMD,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,OAAO,CAyBzE;AAuHD,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvB,CAoBA;AAiJD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAS/D,CAAC"}
|