@supersoniks/concorde 5.1.0 → 5.1.1
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/.claude/launch.json +15 -0
- package/.claude/vite.http.config.mjs +7 -0
- package/.taste-skill/after/desktop-fold.jpg +0 -0
- package/.taste-skill/after/desktop-page-01.jpg +0 -0
- package/.taste-skill/after/desktop-page-02.jpg +0 -0
- package/.taste-skill/after/desktop-page-03.jpg +0 -0
- package/.taste-skill/after/mobile-fold.jpg +0 -0
- package/.taste-skill/after/mobile-page-01.jpg +0 -0
- package/.taste-skill/after/report.json +4103 -0
- package/.taste-skill/after/tablet-fold.jpg +0 -0
- package/.taste-skill/after/tablet-page-01.jpg +0 -0
- package/.taste-skill/after/tablet-page-02.jpg +0 -0
- package/.taste-skill/before/desktop-fold.jpg +0 -0
- package/.taste-skill/before/desktop-page-01.jpg +0 -0
- package/.taste-skill/before/desktop-page-02.jpg +0 -0
- package/.taste-skill/before/mobile-fold.jpg +0 -0
- package/.taste-skill/before/mobile-page-01.jpg +0 -0
- package/.taste-skill/before/report.json +2556 -0
- package/.taste-skill/before/tablet-fold.jpg +0 -0
- package/.taste-skill/before/tablet-page-01.jpg +0 -0
- package/.taste-skill/direction.json +510 -0
- package/.taste-skill/notes.md +84 -0
- package/.taste-skill/prod/desktop-fold.jpg +0 -0
- package/.taste-skill/prod/desktop-page-01.jpg +0 -0
- package/.taste-skill/prod/desktop-page-02.jpg +0 -0
- package/.taste-skill/prod/desktop-page-03.jpg +0 -0
- package/.taste-skill/prod/mobile-fold.jpg +0 -0
- package/.taste-skill/prod/mobile-page-01.jpg +0 -0
- package/.taste-skill/prod/mobile-page-02.jpg +0 -0
- package/.taste-skill/prod/report.json +1973 -0
- package/.taste-skill/prod/tablet-fold.jpg +0 -0
- package/.taste-skill/prod/tablet-page-01.jpg +0 -0
- package/.taste-skill/prod/tablet-page-02.jpg +0 -0
- package/.tmp-cem/custom-elements.json +1939 -1939
- package/AUDIT.md +228 -0
- package/PLAN-AMELIORATION.md +220 -0
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +16 -16
- package/concorde-core.es.js +235 -233
- package/dist/concorde-core.bundle.js +16 -16
- package/dist/concorde-core.es.js +235 -233
- package/dist/img/archive/concorde-001-2cv.webp +0 -0
- package/dist/img/archive/concorde-red-arrows-2002-poster.jpg +0 -0
- package/dist/img/archive/concorde-red-arrows-2002.webm +0 -0
- package/dist/img/archive/credits.json +28 -0
- package/docs/assets/index-Bb-_LRyY.js +12280 -0
- package/docs/assets/index-CD4WyL6o.css +1 -0
- package/docs/docs-mock-api-sw.js +2 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +9 -7
- package/index.html +27 -63
- package/package.json +11 -4
- package/public/img/archive/concorde-001-2cv.webp +0 -0
- package/public/img/archive/concorde-red-arrows-2002-poster.jpg +0 -0
- package/public/img/archive/concorde-red-arrows-2002.webm +0 -0
- package/public/img/archive/credits.json +28 -0
- package/scripts/post-build-docs.js +0 -0
- package/scripts/post-build.mjs +0 -0
- package/src/core/components/functional/fetch/fetch.md +2 -2
- package/src/core/components/functional/if/if.md +0 -0
- package/src/core/components/functional/if/if.ts +0 -0
- package/src/core/components/functional/list/list.demo.ts +0 -0
- package/src/core/components/functional/list/list.md +0 -0
- package/src/core/components/functional/router/router.md +0 -0
- package/src/core/components/functional/router/router.ts +0 -0
- package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +0 -0
- package/src/core/components/functional/sdui/component-catalog.gaps.json +1 -1
- package/src/core/components/functional/sdui/component-catalog.json +1 -1
- package/src/core/components/functional/sdui/types.ts +0 -0
- package/src/core/components/functional/states/states.md +0 -0
- package/src/core/components/functional/submit/submit.md +0 -0
- package/src/core/components/functional/subscriber/subscriber.ts +0 -0
- package/src/core/components/functional/value/value.ts +0 -0
- package/src/core/components/ui/_css/size.ts +0 -0
- package/src/core/components/ui/captcha/altchaStyles.ts +0 -0
- package/src/core/components/ui/form/radio/radio.md +0 -0
- package/src/core/components/ui/form/select/select.md +0 -0
- package/src/core/components/ui/form/switch/switch.md +0 -0
- package/src/core/components/ui/modal/modal.ts +14 -11
- package/src/core/mixins/Subscriber.ts +0 -0
- package/src/core/utils/DataBindObserver.ts +0 -0
- package/src/core/utils/Objects.ts +0 -0
- package/src/core/utils/route.ts +0 -0
- package/src/docs/_core-concept/subscriber.md +0 -0
- package/src/docs/_getting-started/components.md +5 -0
- package/src/docs/_getting-started/my-first-subscriber.md +0 -0
- package/src/docs/_getting-started/pubsub.md +0 -0
- package/src/docs/_getting-started/theming.md +2 -2
- package/src/docs/code.ts +88 -75
- package/src/docs/components/docs-demo-sources.ts +16 -8
- package/src/docs/components/docs-lit-demo.ts +19 -37
- package/src/docs/docs.ts +5 -0
- package/src/docs/example/docs-boarding-pass-demo.ts +134 -0
- package/src/docs/example/docs-provider-keys.ts +12 -0
- package/src/docs/example/users.ts +0 -0
- package/src/docs/header/header.ts +233 -69
- package/src/docs/home/catalog.ts +44 -0
- package/src/docs/home/home.ts +513 -0
- package/src/docs/home/mach-stage.ts +389 -0
- package/src/docs/layout.ts +3 -1
- package/src/docs/navigation/components-index.ts +56 -0
- package/src/docs/navigation/navigation.ts +240 -232
- package/src/docs/navigation/pager.ts +67 -0
- package/src/docs/navigation/toc.ts +98 -0
- package/src/docs/search/docs-search.json +330 -20
- package/src/docs/search/markdown-renderer.ts +11 -3
- package/src/docs/search/page.ts +0 -0
- package/src/docs/shiki/index.ts +109 -0
- package/src/docs/tailwind/css/base/scrollbar.css +22 -0
- package/src/docs/tailwind/css/base/theme.css +96 -0
- package/src/docs/tailwind/css/base/typography.css +4 -0
- package/src/docs/tailwind/css/docs/boarding-pass.css +65 -0
- package/src/docs/tailwind/css/docs/content.css +32 -0
- package/src/docs/tailwind/css/docs/page.css +10 -0
- package/src/docs/tailwind/css/docs.css +9 -0
- package/src/docs/tailwind/css/home/hero.css +210 -0
- package/src/docs/tailwind/css/home/motion.css +84 -0
- package/src/docs/tailwind/css/home/sections.css +416 -0
- package/src/docs/tailwind/css/tailwind.css +7 -185
- package/src/tsconfig.json +23 -2
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +8 -4
- package/.github/workflows/ci.yml +0 -21
- package/.github-export-ignore +0 -30
- package/CONTRIBUTING.md +0 -59
- package/DEV.md +0 -54
- package/LICENSE +0 -21
- package/OPEN_SOURCE_CHECKPOINT.md +0 -133
- package/concorde-3d.bundle.js +0 -3960
- package/concorde-3d.es.js +0 -33433
- package/concorde-hugging-face-infer.bundle.js +0 -32
- package/concorde-hugging-face-infer.es.js +0 -2952
- package/concorde-interactive.bundle.js +0 -1157
- package/concorde-interactive.es.js +0 -10734
- package/concorde-shader.bundle.js +0 -116
- package/concorde-shader.es.js +0 -8353
- package/concorde-webgpu.bundle.js +0 -307
- package/concorde-webgpu.es.js +0 -8627
- package/docs/assets/index-D8MVWqY6.js +0 -12251
- package/docs/assets/index-DiD0qYvE.css +0 -1
- package/docs/crawl/core/components/functional/date/date.html +0 -190
- package/docs/crawl/core/components/functional/fetch/fetch.html +0 -109
- package/docs/crawl/core/components/functional/if/if.html +0 -27
- package/docs/crawl/core/components/functional/jsonata/jsonata.html +0 -79
- package/docs/crawl/core/components/functional/list/list.html +0 -70
- package/docs/crawl/core/components/functional/mix/mix.html +0 -45
- package/docs/crawl/core/components/functional/queue/queue.html +0 -96
- package/docs/crawl/core/components/functional/router/router.html +0 -106
- package/docs/crawl/core/components/functional/sdui/sdui.html +0 -269
- package/docs/crawl/core/components/functional/states/states.html +0 -66
- package/docs/crawl/core/components/functional/submit/submit.html +0 -160
- package/docs/crawl/core/components/functional/subscriber/subscriber.html +0 -67
- package/docs/crawl/core/components/functional/value/value.html +0 -51
- package/docs/crawl/core/components/ui/alert/alert.html +0 -110
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +0 -23
- package/docs/crawl/core/components/ui/badge/badge.html +0 -119
- package/docs/crawl/core/components/ui/button/button.html +0 -149
- package/docs/crawl/core/components/ui/captcha/captcha.html +0 -30
- package/docs/crawl/core/components/ui/card/card.html +0 -99
- package/docs/crawl/core/components/ui/divider/divider.html +0 -58
- package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +0 -73
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +0 -135
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +0 -79
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +0 -62
- package/docs/crawl/core/components/ui/form/input/input.html +0 -109
- package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +0 -38
- package/docs/crawl/core/components/ui/form/radio/radio.html +0 -56
- package/docs/crawl/core/components/ui/form/select/select.html +0 -73
- package/docs/crawl/core/components/ui/form/switch/switch.html +0 -56
- package/docs/crawl/core/components/ui/form/textarea/textarea.html +0 -59
- package/docs/crawl/core/components/ui/group/group.html +0 -82
- package/docs/crawl/core/components/ui/icon/icon.html +0 -133
- package/docs/crawl/core/components/ui/image/image.html +0 -110
- package/docs/crawl/core/components/ui/link/link.html +0 -42
- package/docs/crawl/core/components/ui/loader/loader.html +0 -50
- package/docs/crawl/core/components/ui/menu/menu.html +0 -322
- package/docs/crawl/core/components/ui/modal/modal.html +0 -117
- package/docs/crawl/core/components/ui/pop/pop.html +0 -102
- package/docs/crawl/core/components/ui/progress/progress.html +0 -58
- package/docs/crawl/core/components/ui/table/table.html +0 -413
- package/docs/crawl/core/components/ui/toast/toast.html +0 -122
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +0 -79
- package/docs/crawl/docs/_core-concept/dataFlow.html +0 -177
- package/docs/crawl/docs/_core-concept/overview.html +0 -66
- package/docs/crawl/docs/_core-concept/subscriber.html +0 -75
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +0 -116
- package/docs/crawl/docs/_decorators/auto-subscribe.html +0 -202
- package/docs/crawl/docs/_decorators/bind.html +0 -141
- package/docs/crawl/docs/_decorators/get.html +0 -149
- package/docs/crawl/docs/_decorators/handle.html +0 -165
- package/docs/crawl/docs/_decorators/on-assign.html +0 -355
- package/docs/crawl/docs/_decorators/patch.html +0 -78
- package/docs/crawl/docs/_decorators/post.html +0 -139
- package/docs/crawl/docs/_decorators/publish.html +0 -61
- package/docs/crawl/docs/_decorators/put.html +0 -78
- package/docs/crawl/docs/_decorators/subscribe.html +0 -109
- package/docs/crawl/docs/_decorators/wait-for-ancestors.html +0 -137
- package/docs/crawl/docs/_directives/sub.html +0 -93
- package/docs/crawl/docs/_getting-started/ai-agents.html +0 -173
- package/docs/crawl/docs/_getting-started/concorde-manual-install.html +0 -100
- package/docs/crawl/docs/_getting-started/concorde-outside.html +0 -58
- package/docs/crawl/docs/_getting-started/create-a-component.html +0 -111
- package/docs/crawl/docs/_getting-started/my-first-component.html +0 -189
- package/docs/crawl/docs/_getting-started/my-first-subscriber.html +0 -110
- package/docs/crawl/docs/_getting-started/pubsub.html +0 -62
- package/docs/crawl/docs/_getting-started/start.html +0 -76
- package/docs/crawl/docs/_getting-started/theming.html +0 -85
- package/docs/crawl/docs/_misc/api-configuration.html +0 -149
- package/docs/crawl/docs/_misc/dataProviderKey.html +0 -135
- package/docs/crawl/docs/_misc/docs-mock-api.html +0 -158
- package/docs/crawl/docs/_misc/dynamic-path.html +0 -180
- package/docs/crawl/docs/_misc/endpoint.html +0 -50
- package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +0 -138
- package/docs/crawl/docs/_misc/html-integration.html +0 -48
- package/docs/crawl/hubs/decorators.html +0 -547
- package/docs/crawl/hubs/form-components.html +0 -359
- package/docs/crawl/hubs/remote-data.html +0 -452
- package/docs/crawl/index.html +0 -101
- package/docs/llms-full.txt +0 -5761
- package/docs/llms.txt +0 -104
- package/docs/sitemap.xml +0 -237
- package/docs/src/core/components/functional/date/date.md +0 -290
- package/docs/src/core/components/functional/fetch/fetch.md +0 -125
- package/docs/src/core/components/functional/if/if.md +0 -9
- package/docs/src/core/components/functional/jsonata/jsonata.md +0 -56
- package/docs/src/core/components/functional/list/list.md +0 -65
- package/docs/src/core/components/functional/mix/mix.md +0 -41
- package/docs/src/core/components/functional/queue/queue.md +0 -72
- package/docs/src/core/components/functional/router/router.md +0 -94
- package/docs/src/core/components/functional/sdui/default-library.json +0 -108
- package/docs/src/core/components/functional/sdui/example.json +0 -99
- package/docs/src/core/components/functional/sdui/sdui.md +0 -356
- package/docs/src/core/components/functional/states/states.md +0 -87
- package/docs/src/core/components/functional/submit/submit.md +0 -114
- package/docs/src/core/components/functional/subscriber/subscriber.md +0 -91
- package/docs/src/core/components/functional/value/value.md +0 -35
- package/docs/src/core/components/ui/alert/alert.md +0 -121
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
- package/docs/src/core/components/ui/badge/badge.md +0 -127
- package/docs/src/core/components/ui/button/button.md +0 -182
- package/docs/src/core/components/ui/captcha/captcha.md +0 -12
- package/docs/src/core/components/ui/card/card.md +0 -97
- package/docs/src/core/components/ui/divider/divider.md +0 -35
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -77
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +0 -129
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +0 -77
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +0 -44
- package/docs/src/core/components/ui/form/input/input.md +0 -142
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -29
- package/docs/src/core/components/ui/form/radio/radio.md +0 -57
- package/docs/src/core/components/ui/form/select/select.md +0 -71
- package/docs/src/core/components/ui/form/switch/switch.md +0 -57
- package/docs/src/core/components/ui/form/textarea/textarea.md +0 -65
- package/docs/src/core/components/ui/group/group.md +0 -75
- package/docs/src/core/components/ui/icon/icon.md +0 -125
- package/docs/src/core/components/ui/icon/icons.json +0 -1
- package/docs/src/core/components/ui/image/image.md +0 -107
- package/docs/src/core/components/ui/link/link.md +0 -43
- package/docs/src/core/components/ui/loader/loader.md +0 -55
- package/docs/src/core/components/ui/menu/menu.md +0 -329
- package/docs/src/core/components/ui/modal/modal.md +0 -119
- package/docs/src/core/components/ui/pop/pop.md +0 -96
- package/docs/src/core/components/ui/progress/progress.md +0 -63
- package/docs/src/core/components/ui/table/table.md +0 -455
- package/docs/src/core/components/ui/toast/toast.md +0 -166
- package/docs/src/core/components/ui/tooltip/tooltip.md +0 -82
- package/docs/src/docs/_core-concept/dataFlow.md +0 -88
- package/docs/src/docs/_core-concept/overview.md +0 -57
- package/docs/src/docs/_core-concept/subscriber.md +0 -75
- package/docs/src/docs/_decorators/ancestor-attribute.md +0 -127
- package/docs/src/docs/_decorators/auto-subscribe.md +0 -202
- package/docs/src/docs/_decorators/bind.md +0 -167
- package/docs/src/docs/_decorators/get.md +0 -162
- package/docs/src/docs/_decorators/handle.md +0 -175
- package/docs/src/docs/_decorators/on-assign.md +0 -390
- package/docs/src/docs/_decorators/patch.md +0 -70
- package/docs/src/docs/_decorators/post.md +0 -146
- package/docs/src/docs/_decorators/publish.md +0 -55
- package/docs/src/docs/_decorators/put.md +0 -70
- package/docs/src/docs/_decorators/subscribe.md +0 -100
- package/docs/src/docs/_decorators/wait-for-ancestors.md +0 -163
- package/docs/src/docs/_directives/sub.md +0 -91
- package/docs/src/docs/_getting-started/ai-agents.md +0 -76
- package/docs/src/docs/_getting-started/concorde-manual-install.md +0 -133
- package/docs/src/docs/_getting-started/concorde-outside.md +0 -33
- package/docs/src/docs/_getting-started/create-a-component.md +0 -139
- package/docs/src/docs/_getting-started/my-first-component.md +0 -236
- package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -120
- package/docs/src/docs/_getting-started/pubsub.md +0 -37
- package/docs/src/docs/_getting-started/start.md +0 -47
- package/docs/src/docs/_getting-started/theming.md +0 -91
- package/docs/src/docs/_misc/api-configuration.md +0 -81
- package/docs/src/docs/_misc/dataProviderKey.md +0 -168
- package/docs/src/docs/_misc/docs-mock-api.md +0 -63
- package/docs/src/docs/_misc/dynamic-path.md +0 -71
- package/docs/src/docs/_misc/endpoint.md +0 -45
- package/docs/src/docs/_misc/formelement-subscriber-removal.md +0 -115
- package/docs/src/docs/_misc/html-integration.md +0 -15
- package/docs/src/docs/search/docs-search.json +0 -9507
- package/docs/src/tag-list.json +0 -1
- package/docs/src/tsconfig-model.json +0 -23
- package/docs/src/tsconfig.declarations.json +0 -22
- package/docs/src/tsconfig.emit.json +0 -23
- package/docs/src/tsconfig.json +0 -1182
- package/gitlab/job_github_mirror.sh +0 -39
- package/scripts/github-export.mjs +0 -150
- package/src/css.d.ts +0 -19
- package/src/docs/prism/index.ts +0 -6
- package/src/docs/prism/prism.css +0 -158
- package/src/docs/prism/prism.js +0 -1022
- package/src/tsconfig.declarations.json +0 -22
- package/src/tsconfig.emit.json +0 -23
|
File without changes
|
package/scripts/post-build.mjs
CHANGED
|
File without changes
|
|
@@ -21,8 +21,8 @@ This attribute can be inherited from an ancestor.
|
|
|
21
21
|
|
|
22
22
|
<sonic-code>
|
|
23
23
|
<template>
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
<sonic-fetch serviceURL="/docs-mock-api" endPoint="api/users?page=2" dataProvider="myDataObj"></sonic-fetch>
|
|
25
|
+
<sonic-button dataProvider="myDataObj" debug>Hover to see the data</sonic-button>
|
|
26
26
|
</template>
|
|
27
27
|
</sonic-code>
|
|
28
28
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -555,18 +555,21 @@ export class Modal extends Subscriber(LitElement) {
|
|
|
555
555
|
},
|
|
556
556
|
),
|
|
557
557
|
);
|
|
558
|
-
animations.push(
|
|
559
|
-
element.animate(
|
|
560
|
-
[{ opacity: isEntering ? 0 : 1 }, { opacity: isEntering ? 1 : 0 }],
|
|
561
|
-
{
|
|
562
|
-
duration: duration,
|
|
563
|
-
easing: linear,
|
|
564
|
-
fill: "both",
|
|
565
|
-
delay: delay,
|
|
566
|
-
},
|
|
567
|
-
),
|
|
568
|
-
);
|
|
569
558
|
}
|
|
559
|
+
// The dialog starts at opacity 0 in CSS: every effect must fade it,
|
|
560
|
+
// "none" just does it instantly.
|
|
561
|
+
const instant = this.effect === "none";
|
|
562
|
+
animations.push(
|
|
563
|
+
element.animate(
|
|
564
|
+
[{ opacity: isEntering ? 0 : 1 }, { opacity: isEntering ? 1 : 0 }],
|
|
565
|
+
{
|
|
566
|
+
duration: instant ? 0 : duration,
|
|
567
|
+
easing: linear,
|
|
568
|
+
fill: "both",
|
|
569
|
+
delay: instant ? 0 : delay,
|
|
570
|
+
},
|
|
571
|
+
),
|
|
572
|
+
);
|
|
570
573
|
|
|
571
574
|
Promise.all(animations.map((anim) => anim.finished)).then(() =>
|
|
572
575
|
resolve(),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/core/utils/route.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Theming
|
|
2
2
|
|
|
3
3
|
## Theme-first customization
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ Concorde derives radius steps, button/input rounding, shadows, and most per-comp
|
|
|
10
10
|
|
|
11
11
|
<sonic-code language="html">
|
|
12
12
|
<template>
|
|
13
|
-
<sonic-theme color font
|
|
13
|
+
<sonic-theme color font >
|
|
14
14
|
<!-- your app -->
|
|
15
15
|
</sonic-theme>
|
|
16
16
|
</template>
|
package/src/docs/code.ts
CHANGED
|
@@ -7,42 +7,18 @@ import { query } from "lit/decorators/query.js";
|
|
|
7
7
|
|
|
8
8
|
import SDUIUtils from "../core/components/functional/sdui/sdui-utils";
|
|
9
9
|
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import "prismjs/components/prism-typescript"; // Language
|
|
16
|
-
import "prismjs/components/prism-javascript"; // Language
|
|
17
|
-
import "prismjs/components/prism-bash"; // Language
|
|
18
|
-
// import "prismjs/components/prism-css"; // Language
|
|
19
|
-
import "prismjs/components/prism-markup"; // Language
|
|
20
|
-
|
|
21
|
-
let normalizeWhitespaceDefaultsApplied = false;
|
|
22
|
-
|
|
23
|
-
function normalizeDocsCodeLanguage(language: string): string {
|
|
24
|
-
return language === "html" ? "markup" : language;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function applyNormalizeWhitespaceDefaults(): void {
|
|
28
|
-
if (normalizeWhitespaceDefaultsApplied) return;
|
|
29
|
-
normalizeWhitespaceDefaultsApplied = true;
|
|
30
|
-
Prism.plugins.NormalizeWhitespace.setDefaults({
|
|
31
|
-
"remove-trailing": true,
|
|
32
|
-
"remove-indent": true,
|
|
33
|
-
"left-trim": true,
|
|
34
|
-
"right-trim": true,
|
|
35
|
-
"remove-initial-line-feed": true,
|
|
36
|
-
"tabs-to-tabs": 2,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
10
|
+
import {
|
|
11
|
+
docsCodeCSS,
|
|
12
|
+
highlightDocsCode,
|
|
13
|
+
normalizeDocsCodeLanguage,
|
|
14
|
+
} from "./shiki";
|
|
39
15
|
|
|
40
16
|
const tagName = "sonic-code";
|
|
41
17
|
@customElement(tagName)
|
|
42
18
|
export class DocsCode extends LitElement {
|
|
43
19
|
static styles = [
|
|
44
20
|
tailwind,
|
|
45
|
-
|
|
21
|
+
docsCodeCSS,
|
|
46
22
|
css`
|
|
47
23
|
:host(:not([inline])) {
|
|
48
24
|
display: block;
|
|
@@ -53,11 +29,7 @@ export class DocsCode extends LitElement {
|
|
|
53
29
|
display: inline-block;
|
|
54
30
|
}
|
|
55
31
|
pre {
|
|
56
|
-
font-size: 13px !important;
|
|
57
32
|
padding-right: 5rem !important;
|
|
58
|
-
border: 1px solid var(--sc-base-200);
|
|
59
|
-
border-radius: var(--sc-rounded);
|
|
60
|
-
margin: 0 !important;
|
|
61
33
|
}
|
|
62
34
|
.custom-scroll {
|
|
63
35
|
overflow: auto !important;
|
|
@@ -82,6 +54,34 @@ export class DocsCode extends LitElement {
|
|
|
82
54
|
border-radius: var(--sc-rounded);
|
|
83
55
|
border: solid 0.15rem transparent;
|
|
84
56
|
}
|
|
57
|
+
|
|
58
|
+
/* Tall blocks are folded behind a fade; a click unfolds them */
|
|
59
|
+
pre.collapsible {
|
|
60
|
+
transition: max-height 0.4s ease;
|
|
61
|
+
}
|
|
62
|
+
pre.collapsible:not(.expanded) {
|
|
63
|
+
max-height: var(--docs-code-max-height, 15rem);
|
|
64
|
+
overflow-y: hidden !important;
|
|
65
|
+
}
|
|
66
|
+
pre.overflowing:not(.expanded) {
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
}
|
|
69
|
+
/* fade the code only: the block keeps its background and corners */
|
|
70
|
+
pre.overflowing:not(.expanded) > code {
|
|
71
|
+
display: block;
|
|
72
|
+
/* span the longest line, or the mask would clip horizontal overflow */
|
|
73
|
+
width: max-content;
|
|
74
|
+
min-width: 100%;
|
|
75
|
+
/* fade over the last 11rem; on hover the mask slides down a little */
|
|
76
|
+
mask-image: linear-gradient(to bottom, #000 calc(100% - 11rem), transparent);
|
|
77
|
+
mask-size: 100% var(--docs-code-max-height, 20rem);
|
|
78
|
+
mask-repeat: no-repeat;
|
|
79
|
+
mask-position: 0 -2rem;
|
|
80
|
+
transition: mask-position 0.35s ease;
|
|
81
|
+
}
|
|
82
|
+
pre.overflowing:not(.expanded):hover > code {
|
|
83
|
+
mask-position: 0 0;
|
|
84
|
+
}
|
|
85
85
|
`,
|
|
86
86
|
];
|
|
87
87
|
|
|
@@ -90,6 +90,8 @@ export class DocsCode extends LitElement {
|
|
|
90
90
|
@property({ type: Boolean, reflect: true }) showCode = false;
|
|
91
91
|
@property({ type: Boolean, reflect: true }) toggleCode = false;
|
|
92
92
|
@property({ type: Boolean, reflect: true }) noEdit = false;
|
|
93
|
+
/** Markup shown as code only: no live preview (e.g. PHP / Vue snippets). */
|
|
94
|
+
@property({ type: Boolean, reflect: true }) noPreview = false;
|
|
93
95
|
|
|
94
96
|
@property() language = "markup";
|
|
95
97
|
@property({ attribute: false }) defaultCode?: string;
|
|
@@ -101,14 +103,16 @@ export class DocsCode extends LitElement {
|
|
|
101
103
|
private templateEl: HTMLTemplateElement | null = null;
|
|
102
104
|
|
|
103
105
|
@state() codeEdited = false;
|
|
106
|
+
@state() private overflowing = false;
|
|
107
|
+
@state() private expanded = false;
|
|
104
108
|
|
|
105
109
|
/** Live preview only for markup (avoid injecting HTML from JS/TS examples). */
|
|
106
|
-
private get
|
|
110
|
+
private get highlightLanguage(): string {
|
|
107
111
|
return normalizeDocsCodeLanguage(this.language);
|
|
108
112
|
}
|
|
109
113
|
|
|
110
114
|
private get rendersLiveOutput(): boolean {
|
|
111
|
-
return this.
|
|
115
|
+
return this.highlightLanguage === "html" && !this.noPreview;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
connectedCallback() {
|
|
@@ -128,29 +132,12 @@ export class DocsCode extends LitElement {
|
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
134
|
|
|
131
|
-
private
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
.normalize(source)
|
|
136
|
-
.replaceAll('=""', "")
|
|
137
|
-
.replaceAll(""", '"')
|
|
138
|
-
.replaceAll('"{', "'{")
|
|
139
|
-
.replaceAll('}"', "}'")
|
|
140
|
-
.replaceAll("&", "&");
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
private highlightSource(source: string): string {
|
|
144
|
-
const lang = this.prismLanguage;
|
|
145
|
-
const grammar = Prism.languages[lang];
|
|
146
|
-
if (!grammar) {
|
|
147
|
-
return source;
|
|
135
|
+
private async applyHighlightFromSource(source: string | undefined) {
|
|
136
|
+
if (!source) {
|
|
137
|
+
this.currentCode = undefined;
|
|
138
|
+
return;
|
|
148
139
|
}
|
|
149
|
-
|
|
150
|
-
this.normalizeSourceForHighlight(source),
|
|
151
|
-
grammar,
|
|
152
|
-
lang,
|
|
153
|
-
);
|
|
140
|
+
this.currentCode = await highlightDocsCode(source, this.language);
|
|
154
141
|
}
|
|
155
142
|
|
|
156
143
|
private syncFromTemplate() {
|
|
@@ -158,11 +145,7 @@ export class DocsCode extends LitElement {
|
|
|
158
145
|
this.defaultCode = this.readTemplateSourceCode();
|
|
159
146
|
this.codeEdited = false;
|
|
160
147
|
|
|
161
|
-
|
|
162
|
-
this.currentCode = this.highlightSource(this.defaultCode);
|
|
163
|
-
} else {
|
|
164
|
-
this.currentCode = undefined;
|
|
165
|
-
}
|
|
148
|
+
void this.applyHighlightFromSource(this.defaultCode);
|
|
166
149
|
|
|
167
150
|
if (this.rendersLiveOutput) {
|
|
168
151
|
this.codeOutput = this.defaultCode;
|
|
@@ -175,11 +158,7 @@ export class DocsCode extends LitElement {
|
|
|
175
158
|
this.defaultCode = this.readTemplateSourceCode();
|
|
176
159
|
this.codeEdited = false;
|
|
177
160
|
|
|
178
|
-
|
|
179
|
-
this.currentCode = this.highlightSource(this.defaultCode);
|
|
180
|
-
} else {
|
|
181
|
-
this.currentCode = undefined;
|
|
182
|
-
}
|
|
161
|
+
void this.applyHighlightFromSource(this.defaultCode);
|
|
183
162
|
|
|
184
163
|
if (this.rendersLiveOutput) {
|
|
185
164
|
this.codeOutput = this.defaultCode;
|
|
@@ -204,7 +183,7 @@ export class DocsCode extends LitElement {
|
|
|
204
183
|
const template = this.templateEl ?? this.querySelector("template");
|
|
205
184
|
if (!template) return "";
|
|
206
185
|
|
|
207
|
-
if (this.
|
|
186
|
+
if (this.highlightLanguage === "html") {
|
|
208
187
|
return this.decodeTemplateEntities(template.innerHTML);
|
|
209
188
|
}
|
|
210
189
|
|
|
@@ -231,7 +210,7 @@ export class DocsCode extends LitElement {
|
|
|
231
210
|
if (this.defaultCode) {
|
|
232
211
|
this.currentCode = "";
|
|
233
212
|
window.requestAnimationFrame(() => {
|
|
234
|
-
|
|
213
|
+
void this.applyHighlightFromSource(this.defaultCode);
|
|
235
214
|
});
|
|
236
215
|
}
|
|
237
216
|
if (this.rendersLiveOutput) {
|
|
@@ -269,6 +248,7 @@ export class DocsCode extends LitElement {
|
|
|
269
248
|
|
|
270
249
|
updated(changedProperties: PropertyValues) {
|
|
271
250
|
super.updated(changedProperties);
|
|
251
|
+
this.measureOverflow();
|
|
272
252
|
if (
|
|
273
253
|
changedProperties.has("codeOutput") ||
|
|
274
254
|
changedProperties.has("language")
|
|
@@ -298,12 +278,38 @@ export class DocsCode extends LitElement {
|
|
|
298
278
|
}
|
|
299
279
|
}
|
|
300
280
|
|
|
281
|
+
private measureOverflow() {
|
|
282
|
+
const pre = this.codePreview;
|
|
283
|
+
if (!pre || this.inline || this.expanded) return;
|
|
284
|
+
// Folding to hide only a few lines is just friction: show those in full.
|
|
285
|
+
if (
|
|
286
|
+
pre.scrollHeight > pre.clientHeight + 4 &&
|
|
287
|
+
pre.scrollHeight < pre.clientHeight * 1.3
|
|
288
|
+
) {
|
|
289
|
+
this.expanded = true;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const overflowing = pre.scrollHeight > pre.clientHeight + 4;
|
|
293
|
+
if (overflowing !== this.overflowing) this.overflowing = overflowing;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
private expand() {
|
|
297
|
+
if (!this.overflowing || this.expanded) return;
|
|
298
|
+
const pre = this.codePreview;
|
|
299
|
+
pre.style.maxHeight = `${pre.scrollHeight}px`;
|
|
300
|
+
// Release the height once unfolded, so edited code can still grow.
|
|
301
|
+
pre.addEventListener("transitionend", () => (pre.style.maxHeight = ""), {
|
|
302
|
+
once: true,
|
|
303
|
+
});
|
|
304
|
+
this.expanded = true;
|
|
305
|
+
}
|
|
306
|
+
|
|
301
307
|
handleGetSDUI() {
|
|
302
308
|
SDUIUtils.toJson(this.templateEl?.content.children);
|
|
303
309
|
}
|
|
304
310
|
|
|
305
311
|
render() {
|
|
306
|
-
const isMarkup = this.
|
|
312
|
+
const isMarkup = this.rendersLiveOutput;
|
|
307
313
|
|
|
308
314
|
return html`
|
|
309
315
|
<div
|
|
@@ -316,7 +322,11 @@ export class DocsCode extends LitElement {
|
|
|
316
322
|
: nothing}
|
|
317
323
|
|
|
318
324
|
<div class="relative">
|
|
319
|
-
<div
|
|
325
|
+
<div
|
|
326
|
+
class="flex justify-end gap-1 z-10 ${this.showCode && this.currentCode
|
|
327
|
+
? "absolute right-2 mt-2"
|
|
328
|
+
: ""}"
|
|
329
|
+
>
|
|
320
330
|
${this.codeEdited
|
|
321
331
|
? html`<sonic-button
|
|
322
332
|
size="2xs"
|
|
@@ -383,10 +393,13 @@ export class DocsCode extends LitElement {
|
|
|
383
393
|
<div>
|
|
384
394
|
<pre
|
|
385
395
|
id="codePreview"
|
|
386
|
-
class="rounded-md custom-scroll language-${this
|
|
387
|
-
.showCode || !this.currentCode
|
|
396
|
+
class="rounded-md custom-scroll language-${this
|
|
397
|
+
.highlightLanguage} ${!this.showCode || !this.currentCode
|
|
388
398
|
? "hidden"
|
|
389
|
-
: ""}"
|
|
399
|
+
: ""} ${this.inline ? "" : "collapsible"} ${this.overflowing
|
|
400
|
+
? "overflowing"
|
|
401
|
+
: ""} ${this.expanded ? "expanded" : ""}"
|
|
402
|
+
@click=${this.expand}
|
|
390
403
|
?contenteditable=${!this.noEdit}
|
|
391
404
|
spellcheck="false"
|
|
392
405
|
@input=${this.updateCodeRender}
|
|
@@ -5,10 +5,7 @@ import { tailwind } from "../tailwind";
|
|
|
5
5
|
import { docsSourceLinks, type DocsSource } from "./docs-source-link";
|
|
6
6
|
import { DOCS_SOURCE_RAW } from "./docs-source-raw";
|
|
7
7
|
import { resolveSourceExcerpt } from "./docs-source-excerpt";
|
|
8
|
-
import "../
|
|
9
|
-
import { prismCSS } from "../prism";
|
|
10
|
-
import * as Prism from "prismjs";
|
|
11
|
-
import "prismjs/components/prism-typescript";
|
|
8
|
+
import { docsCodeCSS, highlightDocsCode } from "../shiki";
|
|
12
9
|
|
|
13
10
|
export type { DocsSource };
|
|
14
11
|
|
|
@@ -23,6 +20,15 @@ export type DocsLitDemoConfig = {
|
|
|
23
20
|
};
|
|
24
21
|
|
|
25
22
|
export const DOCS_LIT_DEMO_REGISTRY: Record<string, DocsLitDemoConfig> = {
|
|
23
|
+
"docs-boarding-pass-demo": {
|
|
24
|
+
sources: [
|
|
25
|
+
{
|
|
26
|
+
path: "src/docs/example/docs-boarding-pass-demo.ts",
|
|
27
|
+
line: 19,
|
|
28
|
+
label: "docs-boarding-pass-demo",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
26
32
|
"docs-toggle-if-demo": {
|
|
27
33
|
sources: [
|
|
28
34
|
{
|
|
@@ -528,15 +534,15 @@ export const DOCS_DEMO_SOURCE_REGISTRY: Record<string, DocsSource[]> = {
|
|
|
528
534
|
],
|
|
529
535
|
};
|
|
530
536
|
|
|
531
|
-
function highlightTs(code: string): string {
|
|
532
|
-
return
|
|
537
|
+
function highlightTs(code: string): Promise<string> {
|
|
538
|
+
return highlightDocsCode(code, "typescript");
|
|
533
539
|
}
|
|
534
540
|
|
|
535
541
|
@customElement("docs-demo-sources")
|
|
536
542
|
export class DocsDemoSources extends LitElement {
|
|
537
543
|
static styles = [
|
|
538
544
|
tailwind,
|
|
539
|
-
|
|
545
|
+
docsCodeCSS,
|
|
540
546
|
css`
|
|
541
547
|
:host {
|
|
542
548
|
display: block;
|
|
@@ -588,7 +594,9 @@ export class DocsDemoSources extends LitElement {
|
|
|
588
594
|
const excerpt = resolveSourceExcerpt(raw, this.forTag, {
|
|
589
595
|
line: primary.line,
|
|
590
596
|
});
|
|
591
|
-
|
|
597
|
+
void highlightTs(excerpt).then((html) => {
|
|
598
|
+
this.highlighted = html;
|
|
599
|
+
});
|
|
592
600
|
}
|
|
593
601
|
|
|
594
602
|
render() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { css, html, LitElement, nothing } from "lit";
|
|
2
|
-
import { customElement, property
|
|
1
|
+
import { css, html, LitElement, nothing, PropertyValues } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
3
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
4
4
|
import { tailwind } from "../tailwind";
|
|
5
5
|
import { docsSourceLinks } from "./docs-source-link";
|
|
@@ -8,17 +8,8 @@ import {
|
|
|
8
8
|
type DocsLitDemoConfig,
|
|
9
9
|
} from "./docs-demo-sources";
|
|
10
10
|
|
|
11
|
-
import "../prism/prism";
|
|
12
|
-
import { prismCSS } from "../prism";
|
|
13
|
-
import * as Prism from "prismjs";
|
|
14
|
-
import "prismjs/components/prism-typescript";
|
|
15
|
-
|
|
16
11
|
import { DOCS_SOURCE_RAW } from "./docs-source-raw";
|
|
17
|
-
import {
|
|
18
|
-
excerptLines,
|
|
19
|
-
excerptForCustomElement,
|
|
20
|
-
resolveSourceExcerpt,
|
|
21
|
-
} from "./docs-source-excerpt";
|
|
12
|
+
import { excerptLines, resolveSourceExcerpt } from "./docs-source-excerpt";
|
|
22
13
|
|
|
23
14
|
export { excerptForCustomElement } from "./docs-source-excerpt";
|
|
24
15
|
|
|
@@ -33,9 +24,9 @@ function resolveDemoExcerpt(
|
|
|
33
24
|
return resolveSourceExcerpt(raw, liveTag);
|
|
34
25
|
}
|
|
35
26
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
/** Escape so tags in the TS excerpt stay text inside <template> (same as home.ts). */
|
|
28
|
+
const escapeCode = (code: string) =>
|
|
29
|
+
code.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
39
30
|
|
|
40
31
|
const tagName = "docs-lit-demo";
|
|
41
32
|
|
|
@@ -43,21 +34,21 @@ const tagName = "docs-lit-demo";
|
|
|
43
34
|
export class DocsLitDemo extends LitElement {
|
|
44
35
|
static styles = [
|
|
45
36
|
tailwind,
|
|
46
|
-
prismCSS,
|
|
47
37
|
css`
|
|
48
38
|
:host {
|
|
49
39
|
display: block;
|
|
50
40
|
margin: 1.1rem 0;
|
|
51
41
|
}
|
|
52
|
-
pre {
|
|
53
|
-
font-size: 13px !important;
|
|
54
|
-
}
|
|
55
42
|
.preview {
|
|
56
43
|
border: 1px solid var(--sc-border, #e5e5e5);
|
|
57
44
|
border-radius: 0.375rem;
|
|
58
45
|
padding: 1rem;
|
|
59
46
|
margin-bottom: 0.75rem;
|
|
60
47
|
}
|
|
48
|
+
/* Nested sonic-code already has its own block margin */
|
|
49
|
+
sonic-code {
|
|
50
|
+
margin: 0;
|
|
51
|
+
}
|
|
61
52
|
`,
|
|
62
53
|
];
|
|
63
54
|
|
|
@@ -66,16 +57,11 @@ export class DocsLitDemo extends LitElement {
|
|
|
66
57
|
|
|
67
58
|
@property({ type: Boolean }) showCode = true;
|
|
68
59
|
|
|
69
|
-
@state() private highlighted = "";
|
|
70
|
-
|
|
71
|
-
private liveHost?: HTMLDivElement;
|
|
72
|
-
|
|
73
60
|
private get config(): DocsLitDemoConfig | undefined {
|
|
74
61
|
return DOCS_LIT_DEMO_REGISTRY[this.forTag];
|
|
75
62
|
}
|
|
76
63
|
|
|
77
|
-
|
|
78
|
-
super.connectedCallback();
|
|
64
|
+
private get excerpt(): string | undefined {
|
|
79
65
|
const cfg = this.config;
|
|
80
66
|
if (!cfg?.sources[0]) return;
|
|
81
67
|
|
|
@@ -85,32 +71,28 @@ export class DocsLitDemo extends LitElement {
|
|
|
85
71
|
return;
|
|
86
72
|
}
|
|
87
73
|
|
|
88
|
-
|
|
89
|
-
const excerpt = resolveDemoExcerpt(raw, liveTag, cfg);
|
|
90
|
-
this.highlighted = highlightTs(excerpt);
|
|
74
|
+
return resolveDemoExcerpt(raw, cfg.liveTag ?? this.forTag, cfg);
|
|
91
75
|
}
|
|
92
76
|
|
|
93
77
|
render() {
|
|
94
78
|
const cfg = this.config;
|
|
95
79
|
if (!cfg) return nothing;
|
|
96
80
|
|
|
97
|
-
const
|
|
81
|
+
const excerpt = this.excerpt;
|
|
98
82
|
|
|
99
83
|
return html`
|
|
100
84
|
${docsSourceLinks(cfg.sources)}
|
|
101
85
|
<div class="preview" data-live-host></div>
|
|
102
|
-
${this.showCode &&
|
|
103
|
-
?
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
><code>${unsafeHTML(this.highlighted)}</code></pre>
|
|
107
|
-
`
|
|
86
|
+
${this.showCode && excerpt
|
|
87
|
+
? unsafeHTML(
|
|
88
|
+
`<sonic-code language="typescript" noEdit noPreview><template>${escapeCode(excerpt)}</template></sonic-code>`,
|
|
89
|
+
)
|
|
108
90
|
: nothing}
|
|
109
91
|
`;
|
|
110
92
|
}
|
|
111
93
|
|
|
112
|
-
firstUpdated() {
|
|
113
|
-
super.firstUpdated();
|
|
94
|
+
firstUpdated(_changedProperties: PropertyValues) {
|
|
95
|
+
super.firstUpdated(_changedProperties);
|
|
114
96
|
this.mountLiveDemo();
|
|
115
97
|
}
|
|
116
98
|
|
package/src/docs/docs.ts
CHANGED
|
@@ -8,6 +8,10 @@ import "./components/docs-demo-sources";
|
|
|
8
8
|
import "./components/docs-lit-demo";
|
|
9
9
|
import "./header/header";
|
|
10
10
|
import "./navigation/navigation";
|
|
11
|
+
import "./navigation/toc";
|
|
12
|
+
import "./navigation/pager";
|
|
13
|
+
import "./navigation/components-index";
|
|
14
|
+
import "./home/home";
|
|
11
15
|
import "./example/users";
|
|
12
16
|
import "./example/docs-users-list";
|
|
13
17
|
import "./example/docs-user-two-scopes";
|
|
@@ -15,6 +19,7 @@ import "./example/docs-joke-demos";
|
|
|
15
19
|
import "./example/docs-queue-demos";
|
|
16
20
|
import "./example/docs-input-autocomplete-demos";
|
|
17
21
|
import "./example/docs-toggle-demos";
|
|
22
|
+
import "./example/docs-boarding-pass-demo";
|
|
18
23
|
import "./example/docs-list-demos";
|
|
19
24
|
import "./example/docs-jsonata-demos";
|
|
20
25
|
import "./example/docs-router-demos";
|