@tanrei/web 0.0.0-stage → 0.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +58 -0
- package/README.md +9743 -2
- package/custom-elements.json +86072 -0
- package/dist/THIRD_PARTY_LICENSES.md +136 -0
- package/dist/accordion.css +812 -0
- package/dist/app-shell.css +493 -0
- package/dist/avatar.css +80 -0
- package/dist/breadcrumbs.css +511 -0
- package/dist/callout.css +65 -0
- package/dist/code.css +595 -0
- package/dist/components/accordion/accordion.d.ts +197 -0
- package/dist/components/accordion/accordion.js +763 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/app-bar/app-bar.d.ts +107 -0
- package/dist/components/app-bar/app-bar.js +295 -0
- package/dist/components/app-bar/app-bar.js.map +1 -0
- package/dist/components/app-bar/app-bar.styles.d.ts +12 -0
- package/dist/components/app-bar/app-bar.styles.js +223 -0
- package/dist/components/app-bar/app-bar.styles.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +220 -0
- package/dist/components/app-shell/app-shell.js +677 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/avatar/avatar.d.ts +162 -0
- package/dist/components/avatar/avatar.js +390 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/avatar.styles.d.ts +9 -0
- package/dist/components/avatar/avatar.styles.js +258 -0
- package/dist/components/avatar/avatar.styles.js.map +1 -0
- package/dist/components/badge/badge.d.ts +59 -0
- package/dist/components/badge/badge.js +176 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/badge.styles.d.ts +1 -0
- package/dist/components/badge/badge.styles.js +106 -0
- package/dist/components/badge/badge.styles.js.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +207 -0
- package/dist/components/bottom-sheet/bottom-sheet.js +724 -0
- package/dist/components/bottom-sheet/bottom-sheet.js.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.d.ts +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.js +393 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +176 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +638 -0
- package/dist/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.d.ts +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +225 -0
- package/dist/components/breadcrumbs/breadcrumbs.styles.js.map +1 -0
- package/dist/components/button/button.d.ts +280 -0
- package/dist/components/button/button.js +530 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/button.styles.d.ts +20 -0
- package/dist/components/button/button.styles.js +328 -0
- package/dist/components/button/button.styles.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +124 -0
- package/dist/components/button-group/button-group.js +287 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/button-group/button-group.styles.d.ts +1 -0
- package/dist/components/button-group/button-group.styles.js +220 -0
- package/dist/components/button-group/button-group.styles.js.map +1 -0
- package/dist/components/button-with-menu/button-with-menu.d.ts +224 -0
- package/dist/components/button-with-menu/button-with-menu.js +635 -0
- package/dist/components/button-with-menu/button-with-menu.js.map +1 -0
- package/dist/components/button-with-menu/button-with-menu.styles.d.ts +15 -0
- package/dist/components/button-with-menu/button-with-menu.styles.js +418 -0
- package/dist/components/button-with-menu/button-with-menu.styles.js.map +1 -0
- package/dist/components/calendar/calendar.d.ts +380 -0
- package/dist/components/calendar/calendar.js +1619 -0
- package/dist/components/calendar/calendar.js.map +1 -0
- package/dist/components/calendar/calendar.styles.d.ts +11 -0
- package/dist/components/calendar/calendar.styles.js +412 -0
- package/dist/components/calendar/calendar.styles.js.map +1 -0
- package/dist/components/callout/callout.d.ts +157 -0
- package/dist/components/callout/callout.js +436 -0
- package/dist/components/callout/callout.js.map +1 -0
- package/dist/components/callout/callout.styles.d.ts +13 -0
- package/dist/components/callout/callout.styles.js +383 -0
- package/dist/components/callout/callout.styles.js.map +1 -0
- package/dist/components/card/card.d.ts +108 -0
- package/dist/components/card/card.js +235 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/card.styles.d.ts +9 -0
- package/dist/components/card/card.styles.js +170 -0
- package/dist/components/card/card.styles.js.map +1 -0
- package/dist/components/carousel/carousel-geometry.d.ts +178 -0
- package/dist/components/carousel/carousel-geometry.js +356 -0
- package/dist/components/carousel/carousel-geometry.js.map +1 -0
- package/dist/components/carousel/carousel.d.ts +401 -0
- package/dist/components/carousel/carousel.js +1352 -0
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/carousel/carousel.styles.d.ts +4 -0
- package/dist/components/carousel/carousel.styles.js +475 -0
- package/dist/components/carousel/carousel.styles.js.map +1 -0
- package/dist/components/chat-composer/chat-composer.d.ts +482 -0
- package/dist/components/chat-composer/chat-composer.js +1374 -0
- package/dist/components/chat-composer/chat-composer.js.map +1 -0
- package/dist/components/chat-composer/chat-composer.styles.d.ts +9 -0
- package/dist/components/chat-composer/chat-composer.styles.js +308 -0
- package/dist/components/chat-composer/chat-composer.styles.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +135 -0
- package/dist/components/checkbox/checkbox.js +296 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +13 -0
- package/dist/components/checkbox/checkbox.styles.js +226 -0
- package/dist/components/checkbox/checkbox.styles.js.map +1 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +199 -0
- package/dist/components/checkbox-group/checkbox-group.js +500 -0
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -0
- package/dist/components/chip/chip.d.ts +176 -0
- package/dist/components/chip/chip.js +376 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/chip/chip.styles.d.ts +10 -0
- package/dist/components/chip/chip.styles.js +465 -0
- package/dist/components/chip/chip.styles.js.map +1 -0
- package/dist/components/chip-field/chip-field.d.ts +315 -0
- package/dist/components/chip-field/chip-field.js +887 -0
- package/dist/components/chip-field/chip-field.js.map +1 -0
- package/dist/components/code-block/code-block.before.d.ts +2 -0
- package/dist/components/code-block/code-block.before.js +193 -0
- package/dist/components/code-block/code-block.before.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +268 -0
- package/dist/components/code-block/code-block.js +1009 -0
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/code-block/code-block.light.d.ts +50 -0
- package/dist/components/code-block/code-block.light.js +287 -0
- package/dist/components/code-block/code-block.light.js.map +1 -0
- package/dist/components/code-block/code-block.lines.d.ts +49 -0
- package/dist/components/code-block/code-block.lines.js +75 -0
- package/dist/components/code-block/code-block.lines.js.map +1 -0
- package/dist/components/code-block/code-block.styles.d.ts +8 -0
- package/dist/components/code-block/code-block.styles.js +212 -0
- package/dist/components/code-block/code-block.styles.js.map +1 -0
- package/dist/components/color-field/color-field.d.ts +120 -0
- package/dist/components/color-field/color-field.js +182 -0
- package/dist/components/color-field/color-field.js.map +1 -0
- package/dist/components/color-input/color-input.d.ts +302 -0
- package/dist/components/color-input/color-input.js +748 -0
- package/dist/components/color-input/color-input.js.map +1 -0
- package/dist/components/color-input/color-input.styles.d.ts +22 -0
- package/dist/components/color-input/color-input.styles.js +373 -0
- package/dist/components/color-input/color-input.styles.js.map +1 -0
- package/dist/components/color-input/color-text.d.ts +48 -0
- package/dist/components/color-input/color-text.js +77 -0
- package/dist/components/color-input/color-text.js.map +1 -0
- package/dist/components/combobox/combobox.d.ts +387 -0
- package/dist/components/combobox/combobox.js +1108 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/combobox/combobox.styles.d.ts +26 -0
- package/dist/components/combobox/combobox.styles.js +497 -0
- package/dist/components/combobox/combobox.styles.js.map +1 -0
- package/dist/components/combobox-field/combobox-field.d.ts +159 -0
- package/dist/components/combobox-field/combobox-field.js +280 -0
- package/dist/components/combobox-field/combobox-field.js.map +1 -0
- package/dist/components/copy-button/copy-button.d.ts +112 -0
- package/dist/components/copy-button/copy-button.js +237 -0
- package/dist/components/copy-button/copy-button.js.map +1 -0
- package/dist/components/copy-button/copy-button.styles.d.ts +1 -0
- package/dist/components/copy-button/copy-button.styles.js +62 -0
- package/dist/components/copy-button/copy-button.styles.js.map +1 -0
- package/dist/components/date-time-picker/date-time-picker.d.ts +603 -0
- package/dist/components/date-time-picker/date-time-picker.js +2537 -0
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -0
- package/dist/components/date-time-picker/date-time-picker.styles.d.ts +1 -0
- package/dist/components/date-time-picker/date-time-picker.styles.js +842 -0
- package/dist/components/date-time-picker/date-time-picker.styles.js.map +1 -0
- package/dist/components/description-list/description-list.d.ts +133 -0
- package/dist/components/description-list/description-list.js +395 -0
- package/dist/components/description-list/description-list.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +140 -0
- package/dist/components/dialog/dialog.js +440 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.styles.js +306 -0
- package/dist/components/dialog/dialog.styles.js.map +1 -0
- package/dist/components/divider/divider.d.ts +112 -0
- package/dist/components/divider/divider.js +331 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/divider/divider.styles.d.ts +6 -0
- package/dist/components/divider/divider.styles.js +183 -0
- package/dist/components/divider/divider.styles.js.map +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.d.ts +246 -0
- package/dist/components/embedded-text-input/embedded-text-input.js +673 -0
- package/dist/components/embedded-text-input/embedded-text-input.js.map +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.d.ts +1 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.js +204 -0
- package/dist/components/embedded-text-input/embedded-text-input.styles.js.map +1 -0
- package/dist/components/empty-state/empty-state.d.ts +132 -0
- package/dist/components/empty-state/empty-state.js +333 -0
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/empty-state/empty-state.styles.d.ts +11 -0
- package/dist/components/empty-state/empty-state.styles.js +218 -0
- package/dist/components/empty-state/empty-state.styles.js.map +1 -0
- package/dist/components/fab-menu/fab-menu.d.ts +240 -0
- package/dist/components/fab-menu/fab-menu.js +605 -0
- package/dist/components/fab-menu/fab-menu.js.map +1 -0
- package/dist/components/fab-menu/fab-menu.styles.d.ts +21 -0
- package/dist/components/fab-menu/fab-menu.styles.js +427 -0
- package/dist/components/fab-menu/fab-menu.styles.js.map +1 -0
- package/dist/components/field/field.d.ts +165 -0
- package/dist/components/field/field.js +399 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/field/field.styles.d.ts +2 -0
- package/dist/components/field/field.styles.js +177 -0
- package/dist/components/field/field.styles.js.map +1 -0
- package/dist/components/field-group/field-group.d.ts +122 -0
- package/dist/components/field-group/field-group.js +246 -0
- package/dist/components/field-group/field-group.js.map +1 -0
- package/dist/components/field-group/field-group.styles.d.ts +7 -0
- package/dist/components/field-group/field-group.styles.js +28 -0
- package/dist/components/field-group/field-group.styles.js.map +1 -0
- package/dist/components/figure/figure.d.ts +152 -0
- package/dist/components/figure/figure.js +435 -0
- package/dist/components/figure/figure.js.map +1 -0
- package/dist/components/file-item/file-item.d.ts +232 -0
- package/dist/components/file-item/file-item.js +665 -0
- package/dist/components/file-item/file-item.js.map +1 -0
- package/dist/components/file-item/file-item.styles.d.ts +2 -0
- package/dist/components/file-item/file-item.styles.js +582 -0
- package/dist/components/file-item/file-item.styles.js.map +1 -0
- package/dist/components/file-picker/file-picker.d.ts +221 -0
- package/dist/components/file-picker/file-picker.js +588 -0
- package/dist/components/file-picker/file-picker.js.map +1 -0
- package/dist/components/file-picker/file-picker.styles.d.ts +2 -0
- package/dist/components/file-picker/file-picker.styles.js +303 -0
- package/dist/components/file-picker/file-picker.styles.js.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +353 -0
- package/dist/components/file-upload/file-upload.js +939 -0
- package/dist/components/file-upload/file-upload.js.map +1 -0
- package/dist/components/file-upload/file-upload.styles.d.ts +1 -0
- package/dist/components/file-upload/file-upload.styles.js +91 -0
- package/dist/components/file-upload/file-upload.styles.js.map +1 -0
- package/dist/components/image-preview/image-preview.d.ts +336 -0
- package/dist/components/image-preview/image-preview.js +1510 -0
- package/dist/components/image-preview/image-preview.js.map +1 -0
- package/dist/components/image-preview/image-preview.styles.d.ts +1 -0
- package/dist/components/image-preview/image-preview.styles.js +418 -0
- package/dist/components/image-preview/image-preview.styles.js.map +1 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.d.ts +94 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.js +285 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.d.ts +11 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.js +155 -0
- package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.js.map +1 -0
- package/dist/components/link-card/link-card.d.ts +156 -0
- package/dist/components/link-card/link-card.js +713 -0
- package/dist/components/link-card/link-card.js.map +1 -0
- package/dist/components/list/list.d.ts +430 -0
- package/dist/components/list/list.js +1230 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/list/list.styles.d.ts +3 -0
- package/dist/components/list/list.styles.js +334 -0
- package/dist/components/list/list.styles.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator.d.ts +83 -0
- package/dist/components/loading-indicator/loading-indicator.js +195 -0
- package/dist/components/loading-indicator/loading-indicator.js.map +1 -0
- package/dist/components/loading-indicator/loading-indicator.styles.d.ts +6 -0
- package/dist/components/loading-indicator/loading-indicator.styles.js +124 -0
- package/dist/components/loading-indicator/loading-indicator.styles.js.map +1 -0
- package/dist/components/main-action-button/main-action-button.d.ts +95 -0
- package/dist/components/main-action-button/main-action-button.js +202 -0
- package/dist/components/main-action-button/main-action-button.js.map +1 -0
- package/dist/components/main-action-button/main-action-button.styles.d.ts +10 -0
- package/dist/components/main-action-button/main-action-button.styles.js +285 -0
- package/dist/components/main-action-button/main-action-button.styles.js.map +1 -0
- package/dist/components/menu/menu.d.ts +813 -0
- package/dist/components/menu/menu.js +2061 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menu/menu.styles.d.ts +18 -0
- package/dist/components/menu/menu.styles.js +587 -0
- package/dist/components/menu/menu.styles.js.map +1 -0
- package/dist/components/menubar/menubar.d.ts +477 -0
- package/dist/components/menubar/menubar.js +1677 -0
- package/dist/components/menubar/menubar.js.map +1 -0
- package/dist/components/menubar/menubar.styles.d.ts +43 -0
- package/dist/components/menubar/menubar.styles.js +379 -0
- package/dist/components/menubar/menubar.styles.js.map +1 -0
- package/dist/components/navigation-bar/navigation-bar.d.ts +239 -0
- package/dist/components/navigation-bar/navigation-bar.js +544 -0
- package/dist/components/navigation-bar/navigation-bar.js.map +1 -0
- package/dist/components/navigation-bar/navigation-bar.styles.d.ts +21 -0
- package/dist/components/navigation-bar/navigation-bar.styles.js +320 -0
- package/dist/components/navigation-bar/navigation-bar.styles.js.map +1 -0
- package/dist/components/navigation-drawer/navigation-drawer.d.ts +627 -0
- package/dist/components/navigation-drawer/navigation-drawer.js +1917 -0
- package/dist/components/navigation-drawer/navigation-drawer.js.map +1 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.d.ts +40 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.js +934 -0
- package/dist/components/navigation-drawer/navigation-drawer.styles.js.map +1 -0
- package/dist/components/number-field/number-field.d.ts +147 -0
- package/dist/components/number-field/number-field.js +252 -0
- package/dist/components/number-field/number-field.js.map +1 -0
- package/dist/components/number-input/number-input.d.ts +347 -0
- package/dist/components/number-input/number-input.js +929 -0
- package/dist/components/number-input/number-input.js.map +1 -0
- package/dist/components/number-input/number-input.styles.d.ts +22 -0
- package/dist/components/number-input/number-input.styles.js +395 -0
- package/dist/components/number-input/number-input.styles.js.map +1 -0
- package/dist/components/number-input/number-text.d.ts +74 -0
- package/dist/components/number-input/number-text.js +230 -0
- package/dist/components/number-input/number-text.js.map +1 -0
- package/dist/components/one-time-code-field/one-time-code-field.d.ts +94 -0
- package/dist/components/one-time-code-field/one-time-code-field.js +135 -0
- package/dist/components/one-time-code-field/one-time-code-field.js.map +1 -0
- package/dist/components/one-time-code-input/code-text.d.ts +51 -0
- package/dist/components/one-time-code-input/code-text.js +145 -0
- package/dist/components/one-time-code-input/code-text.js.map +1 -0
- package/dist/components/one-time-code-input/one-time-code-input.d.ts +219 -0
- package/dist/components/one-time-code-input/one-time-code-input.js +710 -0
- package/dist/components/one-time-code-input/one-time-code-input.js.map +1 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.d.ts +8 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.js +323 -0
- package/dist/components/one-time-code-input/one-time-code-input.styles.js.map +1 -0
- package/dist/components/option/option.d.ts +51 -0
- package/dist/components/option/option.js +75 -0
- package/dist/components/option/option.js.map +1 -0
- package/dist/components/page-header/page-header.d.ts +97 -0
- package/dist/components/page-header/page-header.js +258 -0
- package/dist/components/page-header/page-header.js.map +1 -0
- package/dist/components/popover/popover.d.ts +217 -0
- package/dist/components/popover/popover.js +616 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/popover/popover.styles.d.ts +8 -0
- package/dist/components/popover/popover.styles.js +299 -0
- package/dist/components/popover/popover.styles.js.map +1 -0
- package/dist/components/progress-indicator/progress-indicator.d.ts +76 -0
- package/dist/components/progress-indicator/progress-indicator.js +165 -0
- package/dist/components/progress-indicator/progress-indicator.js.map +1 -0
- package/dist/components/progress-indicator/progress-indicator.styles.d.ts +7 -0
- package/dist/components/progress-indicator/progress-indicator.styles.js +271 -0
- package/dist/components/progress-indicator/progress-indicator.styles.js.map +1 -0
- package/dist/components/radio-button/radio-button.d.ts +149 -0
- package/dist/components/radio-button/radio-button.js +370 -0
- package/dist/components/radio-button/radio-button.js.map +1 -0
- package/dist/components/radio-button/radio-button.styles.d.ts +8 -0
- package/dist/components/radio-button/radio-button.styles.js +190 -0
- package/dist/components/radio-button/radio-button.styles.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +188 -0
- package/dist/components/radio-group/radio-group.js +380 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/search/search.d.ts +569 -0
- package/dist/components/search/search.js +1801 -0
- package/dist/components/search/search.js.map +1 -0
- package/dist/components/search/search.styles.d.ts +15 -0
- package/dist/components/search/search.styles.js +967 -0
- package/dist/components/search/search.styles.js.map +1 -0
- package/dist/components/segmented-button/segmented-button.d.ts +183 -0
- package/dist/components/segmented-button/segmented-button.js +483 -0
- package/dist/components/segmented-button/segmented-button.js.map +1 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +19 -0
- package/dist/components/segmented-button/segmented-button.styles.js +400 -0
- package/dist/components/segmented-button/segmented-button.styles.js.map +1 -0
- package/dist/components/select/select.d.ts +259 -0
- package/dist/components/select/select.js +702 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select/select.styles.d.ts +27 -0
- package/dist/components/select/select.styles.js +359 -0
- package/dist/components/select/select.styles.js.map +1 -0
- package/dist/components/select-field/select-field.d.ts +141 -0
- package/dist/components/select-field/select-field.js +234 -0
- package/dist/components/select-field/select-field.js.map +1 -0
- package/dist/components/side-sheet/side-sheet.d.ts +190 -0
- package/dist/components/side-sheet/side-sheet.js +592 -0
- package/dist/components/side-sheet/side-sheet.js.map +1 -0
- package/dist/components/side-sheet/side-sheet.styles.d.ts +9 -0
- package/dist/components/side-sheet/side-sheet.styles.js +352 -0
- package/dist/components/side-sheet/side-sheet.styles.js.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +157 -0
- package/dist/components/skeleton/skeleton.js +550 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/slider.d.ts +235 -0
- package/dist/components/slider/slider.js +792 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/slider/slider.styles.d.ts +6 -0
- package/dist/components/slider/slider.styles.js +492 -0
- package/dist/components/slider/slider.styles.js.map +1 -0
- package/dist/components/slider-field/slider-field.d.ts +150 -0
- package/dist/components/slider-field/slider-field.js +269 -0
- package/dist/components/slider-field/slider-field.js.map +1 -0
- package/dist/components/snackbar/snackbar.d.ts +237 -0
- package/dist/components/snackbar/snackbar.js +607 -0
- package/dist/components/snackbar/snackbar.js.map +1 -0
- package/dist/components/snackbar/snackbar.styles.d.ts +10 -0
- package/dist/components/snackbar/snackbar.styles.js +510 -0
- package/dist/components/snackbar/snackbar.styles.js.map +1 -0
- package/dist/components/switch/switch.d.ts +161 -0
- package/dist/components/switch/switch.js +470 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/switch/switch.styles.d.ts +3 -0
- package/dist/components/switch/switch.styles.js +440 -0
- package/dist/components/switch/switch.styles.js.map +1 -0
- package/dist/components/tab-view/tab-view.d.ts +303 -0
- package/dist/components/tab-view/tab-view.js +917 -0
- package/dist/components/tab-view/tab-view.js.map +1 -0
- package/dist/components/tab-view/tab-view.styles.d.ts +19 -0
- package/dist/components/tab-view/tab-view.styles.js +85 -0
- package/dist/components/tab-view/tab-view.styles.js.map +1 -0
- package/dist/components/table/table.d.ts +386 -0
- package/dist/components/table/table.js +1320 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +227 -0
- package/dist/components/table-of-contents/table-of-contents.js +963 -0
- package/dist/components/table-of-contents/table-of-contents.js.map +1 -0
- package/dist/components/table-of-contents/table-of-contents.styles.d.ts +1 -0
- package/dist/components/table-of-contents/table-of-contents.styles.js +243 -0
- package/dist/components/table-of-contents/table-of-contents.styles.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +800 -0
- package/dist/components/tabs/tabs.js +2183 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tabs/tabs.styles.d.ts +47 -0
- package/dist/components/tabs/tabs.styles.js +595 -0
- package/dist/components/tabs/tabs.styles.js.map +1 -0
- package/dist/components/tag/tag.d.ts +77 -0
- package/dist/components/tag/tag.js +143 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/tag/tag.styles.d.ts +13 -0
- package/dist/components/tag/tag.styles.js +215 -0
- package/dist/components/tag/tag.styles.js.map +1 -0
- package/dist/components/tag-group/tag-group.d.ts +110 -0
- package/dist/components/tag-group/tag-group.js +298 -0
- package/dist/components/tag-group/tag-group.js.map +1 -0
- package/dist/components/tag-group/tag-group.styles.d.ts +8 -0
- package/dist/components/tag-group/tag-group.styles.js +66 -0
- package/dist/components/tag-group/tag-group.styles.js.map +1 -0
- package/dist/components/text-field/text-field.d.ts +159 -0
- package/dist/components/text-field/text-field.js +272 -0
- package/dist/components/text-field/text-field.js.map +1 -0
- package/dist/components/text-input/text-input-segments.d.ts +93 -0
- package/dist/components/text-input/text-input-segments.js +233 -0
- package/dist/components/text-input/text-input-segments.js.map +1 -0
- package/dist/components/text-input/text-input.d.ts +683 -0
- package/dist/components/text-input/text-input.js +2120 -0
- package/dist/components/text-input/text-input.js.map +1 -0
- package/dist/components/text-input/text-input.styles.d.ts +27 -0
- package/dist/components/text-input/text-input.styles.js +1071 -0
- package/dist/components/text-input/text-input.styles.js.map +1 -0
- package/dist/components/toolbar/toolbar.d.ts +123 -0
- package/dist/components/toolbar/toolbar.js +336 -0
- package/dist/components/toolbar/toolbar.js.map +1 -0
- package/dist/components/toolbar/toolbar.styles.d.ts +10 -0
- package/dist/components/toolbar/toolbar.styles.js +156 -0
- package/dist/components/toolbar/toolbar.styles.js.map +1 -0
- package/dist/components/tooltip/tooltip-placement.d.ts +22 -0
- package/dist/components/tooltip/tooltip-placement.js +15 -0
- package/dist/components/tooltip/tooltip-placement.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +267 -0
- package/dist/components/tooltip/tooltip.js +902 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +7 -0
- package/dist/components/tooltip/tooltip.styles.js +240 -0
- package/dist/components/tooltip/tooltip.styles.js.map +1 -0
- package/dist/components/tree-view/tree-view.d.ts +264 -0
- package/dist/components/tree-view/tree-view.js +1228 -0
- package/dist/components/tree-view/tree-view.js.map +1 -0
- package/dist/description-list.css +337 -0
- package/dist/empty-state.css +70 -0
- package/dist/figure.css +381 -0
- package/dist/generated/icon-sets.d.ts +9 -0
- package/dist/generated/icon-sets.js +18 -0
- package/dist/generated/icon-sets.js.map +1 -0
- package/dist/generated/words.d.ts +161 -0
- package/dist/generated/words.js +91 -0
- package/dist/generated/words.js.map +1 -0
- package/dist/highlight/grammars/css.d.ts +3 -0
- package/dist/highlight/grammars/css.js +56 -0
- package/dist/highlight/grammars/css.js.map +1 -0
- package/dist/highlight/grammars/dart.d.ts +3 -0
- package/dist/highlight/grammars/dart.js +53 -0
- package/dist/highlight/grammars/dart.js.map +1 -0
- package/dist/highlight/grammars/javascript.d.ts +4 -0
- package/dist/highlight/grammars/javascript.js +119 -0
- package/dist/highlight/grammars/javascript.js.map +1 -0
- package/dist/highlight/grammars/json.d.ts +3 -0
- package/dist/highlight/grammars/json.js +19 -0
- package/dist/highlight/grammars/json.js.map +1 -0
- package/dist/highlight/grammars/kotlin.d.ts +3 -0
- package/dist/highlight/grammars/kotlin.js +46 -0
- package/dist/highlight/grammars/kotlin.js.map +1 -0
- package/dist/highlight/grammars/markup.d.ts +3 -0
- package/dist/highlight/grammars/markup.js +45 -0
- package/dist/highlight/grammars/markup.js.map +1 -0
- package/dist/highlight/grammars/shared.d.ts +25 -0
- package/dist/highlight/grammars/shared.js +37 -0
- package/dist/highlight/grammars/shared.js.map +1 -0
- package/dist/highlight/grammars/shell.d.ts +3 -0
- package/dist/highlight/grammars/shell.js +48 -0
- package/dist/highlight/grammars/shell.js.map +1 -0
- package/dist/highlight/grammars/swift.d.ts +3 -0
- package/dist/highlight/grammars/swift.js +46 -0
- package/dist/highlight/grammars/swift.js.map +1 -0
- package/dist/highlight/grammars/typescript.d.ts +2 -0
- package/dist/highlight/grammars/typescript.js +5 -0
- package/dist/highlight/grammars/typescript.js.map +1 -0
- package/dist/highlight/index.d.ts +104 -0
- package/dist/highlight/index.js +331 -0
- package/dist/highlight/index.js.map +1 -0
- package/dist/icons.css +107 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +10 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +100 -0
- package/dist/index.js.map +1 -0
- package/dist/link-card.css +678 -0
- package/dist/link.css +728 -0
- package/dist/link.d.ts +21 -0
- package/dist/link.js +594 -0
- package/dist/link.js.map +1 -0
- package/dist/links/index.d.ts +136 -0
- package/dist/links/index.js +404 -0
- package/dist/links/index.js.map +1 -0
- package/dist/links/node/address.js +154 -0
- package/dist/links/node/cli.js +102 -0
- package/dist/links/node/fetcher.js +267 -0
- package/dist/links/node/head.js +278 -0
- package/dist/links/node/index.d.ts +164 -0
- package/dist/links/node/index.js +26 -0
- package/dist/links/node/links.js +275 -0
- package/dist/links/node/lock.js +86 -0
- package/dist/links/node/mark.js +71 -0
- package/dist/links/node/options.js +120 -0
- package/dist/links/node/pictures.js +265 -0
- package/dist/links/node/refresh.js +28 -0
- package/dist/menu.css +97 -0
- package/dist/menubar.css +69 -0
- package/dist/page-header.css +324 -0
- package/dist/pagination.css +410 -0
- package/dist/pagination.d.ts +6 -0
- package/dist/pagination.js +256 -0
- package/dist/pagination.js.map +1 -0
- package/dist/primitives/actions.d.ts +75 -0
- package/dist/primitives/actions.js +142 -0
- package/dist/primitives/actions.js.map +1 -0
- package/dist/primitives/after-click.d.ts +8 -0
- package/dist/primitives/after-click.js +21 -0
- package/dist/primitives/after-click.js.map +1 -0
- package/dist/primitives/anchored.d.ts +134 -0
- package/dist/primitives/anchored.js +425 -0
- package/dist/primitives/anchored.js.map +1 -0
- package/dist/primitives/arc.d.ts +13 -0
- package/dist/primitives/arc.js +49 -0
- package/dist/primitives/arc.js.map +1 -0
- package/dist/primitives/arrow.d.ts +47 -0
- package/dist/primitives/arrow.js +159 -0
- package/dist/primitives/arrow.js.map +1 -0
- package/dist/primitives/auto-height.d.ts +56 -0
- package/dist/primitives/auto-height.js +150 -0
- package/dist/primitives/auto-height.js.map +1 -0
- package/dist/primitives/autofocus.d.ts +11 -0
- package/dist/primitives/autofocus.js +26 -0
- package/dist/primitives/autofocus.js.map +1 -0
- package/dist/primitives/availability.d.ts +32 -0
- package/dist/primitives/availability.js +122 -0
- package/dist/primitives/availability.js.map +1 -0
- package/dist/primitives/axes.d.ts +45 -0
- package/dist/primitives/axes.js +72 -0
- package/dist/primitives/axes.js.map +1 -0
- package/dist/primitives/behavior.d.ts +14 -0
- package/dist/primitives/behavior.js +19 -0
- package/dist/primitives/behavior.js.map +1 -0
- package/dist/primitives/calendar-date.d.ts +79 -0
- package/dist/primitives/calendar-date.js +135 -0
- package/dist/primitives/calendar-date.js.map +1 -0
- package/dist/primitives/composed.d.ts +144 -0
- package/dist/primitives/composed.js +303 -0
- package/dist/primitives/composed.js.map +1 -0
- package/dist/primitives/default-button.d.ts +49 -0
- package/dist/primitives/default-button.js +270 -0
- package/dist/primitives/default-button.js.map +1 -0
- package/dist/primitives/description.d.ts +18 -0
- package/dist/primitives/description.js +18 -0
- package/dist/primitives/description.js.map +1 -0
- package/dist/primitives/destination.d.ts +259 -0
- package/dist/primitives/destination.js +651 -0
- package/dist/primitives/destination.js.map +1 -0
- package/dist/primitives/direction.d.ts +23 -0
- package/dist/primitives/direction.js +90 -0
- package/dist/primitives/direction.js.map +1 -0
- package/dist/primitives/disabled-while-focused.d.ts +46 -0
- package/dist/primitives/disabled-while-focused.js +126 -0
- package/dist/primitives/disabled-while-focused.js.map +1 -0
- package/dist/primitives/disclosure.d.ts +9 -0
- package/dist/primitives/disclosure.js +15 -0
- package/dist/primitives/disclosure.js.map +1 -0
- package/dist/primitives/dismiss.d.ts +88 -0
- package/dist/primitives/dismiss.js +232 -0
- package/dist/primitives/dismiss.js.map +1 -0
- package/dist/primitives/field-frame.d.ts +166 -0
- package/dist/primitives/field-frame.js +358 -0
- package/dist/primitives/field-frame.js.map +1 -0
- package/dist/primitives/field-group-frame.d.ts +59 -0
- package/dist/primitives/field-group-frame.js +174 -0
- package/dist/primitives/field-group-frame.js.map +1 -0
- package/dist/primitives/field-trigger.d.ts +117 -0
- package/dist/primitives/field-trigger.js +387 -0
- package/dist/primitives/field-trigger.js.map +1 -0
- package/dist/primitives/field.d.ts +186 -0
- package/dist/primitives/field.js +349 -0
- package/dist/primitives/field.js.map +1 -0
- package/dist/primitives/file-format.d.ts +23 -0
- package/dist/primitives/file-format.js +185 -0
- package/dist/primitives/file-format.js.map +1 -0
- package/dist/primitives/file-item-holder.d.ts +45 -0
- package/dist/primitives/file-item-holder.js +39 -0
- package/dist/primitives/file-item-holder.js.map +1 -0
- package/dist/primitives/focus-order.d.ts +11 -0
- package/dist/primitives/focus-order.js +11 -0
- package/dist/primitives/focus-order.js.map +1 -0
- package/dist/primitives/focus-ring.d.ts +76 -0
- package/dist/primitives/focus-ring.js +230 -0
- package/dist/primitives/focus-ring.js.map +1 -0
- package/dist/primitives/follow.d.ts +65 -0
- package/dist/primitives/follow.js +283 -0
- package/dist/primitives/follow.js.map +1 -0
- package/dist/primitives/form-disabled.d.ts +20 -0
- package/dist/primitives/form-disabled.js +46 -0
- package/dist/primitives/form-disabled.js.map +1 -0
- package/dist/primitives/form-says.d.ts +33 -0
- package/dist/primitives/form-says.js +45 -0
- package/dist/primitives/form-says.js.map +1 -0
- package/dist/primitives/forward.d.ts +13 -0
- package/dist/primitives/forward.js +28 -0
- package/dist/primitives/forward.js.map +1 -0
- package/dist/primitives/glyph-mirror.d.ts +77 -0
- package/dist/primitives/glyph-mirror.js +211 -0
- package/dist/primitives/glyph-mirror.js.map +1 -0
- package/dist/primitives/glyph-pending.d.ts +17 -0
- package/dist/primitives/glyph-pending.js +91 -0
- package/dist/primitives/glyph-pending.js.map +1 -0
- package/dist/primitives/glyph.d.ts +53 -0
- package/dist/primitives/glyph.js +161 -0
- package/dist/primitives/glyph.js.map +1 -0
- package/dist/primitives/group-item.d.ts +128 -0
- package/dist/primitives/group-item.js +334 -0
- package/dist/primitives/group-item.js.map +1 -0
- package/dist/primitives/hidden.d.ts +2 -0
- package/dist/primitives/hidden.js +23 -0
- package/dist/primitives/hidden.js.map +1 -0
- package/dist/primitives/host-aria.d.ts +8 -0
- package/dist/primitives/host-aria.js +18 -0
- package/dist/primitives/host-aria.js.map +1 -0
- package/dist/primitives/index.d.ts +59 -0
- package/dist/primitives/index.js +189 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/indicator-drag.d.ts +90 -0
- package/dist/primitives/indicator-drag.js +207 -0
- package/dist/primitives/indicator-drag.js.map +1 -0
- package/dist/primitives/interactive.d.ts +13 -0
- package/dist/primitives/interactive.js +67 -0
- package/dist/primitives/interactive.js.map +1 -0
- package/dist/primitives/item-row.d.ts +34 -0
- package/dist/primitives/item-row.js +76 -0
- package/dist/primitives/item-row.js.map +1 -0
- package/dist/primitives/item-update.d.ts +2 -0
- package/dist/primitives/item-update.js +12 -0
- package/dist/primitives/item-update.js.map +1 -0
- package/dist/primitives/kept-length.d.ts +34 -0
- package/dist/primitives/kept-length.js +154 -0
- package/dist/primitives/kept-length.js.map +1 -0
- package/dist/primitives/keyboard-convention.d.ts +30 -0
- package/dist/primitives/keyboard-convention.js +88 -0
- package/dist/primitives/keyboard-convention.js.map +1 -0
- package/dist/primitives/label-lines.d.ts +12 -0
- package/dist/primitives/label-lines.js +34 -0
- package/dist/primitives/label-lines.js.map +1 -0
- package/dist/primitives/layout-scale.d.ts +18 -0
- package/dist/primitives/layout-scale.js +35 -0
- package/dist/primitives/layout-scale.js.map +1 -0
- package/dist/primitives/link.d.ts +147 -0
- package/dist/primitives/link.js +204 -0
- package/dist/primitives/link.js.map +1 -0
- package/dist/primitives/locale-date.d.ts +132 -0
- package/dist/primitives/locale-date.js +508 -0
- package/dist/primitives/locale-date.js.map +1 -0
- package/dist/primitives/missing-value.d.ts +16 -0
- package/dist/primitives/missing-value.js +31 -0
- package/dist/primitives/missing-value.js.map +1 -0
- package/dist/primitives/modal.d.ts +38 -0
- package/dist/primitives/modal.js +175 -0
- package/dist/primitives/modal.js.map +1 -0
- package/dist/primitives/native-text.d.ts +51 -0
- package/dist/primitives/native-text.js +77 -0
- package/dist/primitives/native-text.js.map +1 -0
- package/dist/primitives/natural-height.d.ts +21 -0
- package/dist/primitives/natural-height.js +36 -0
- package/dist/primitives/natural-height.js.map +1 -0
- package/dist/primitives/option-list.d.ts +314 -0
- package/dist/primitives/option-list.js +1098 -0
- package/dist/primitives/option-list.js.map +1 -0
- package/dist/primitives/overlay-focus.d.ts +48 -0
- package/dist/primitives/overlay-focus.js +152 -0
- package/dist/primitives/overlay-focus.js.map +1 -0
- package/dist/primitives/placement.d.ts +131 -0
- package/dist/primitives/placement.js +144 -0
- package/dist/primitives/placement.js.map +1 -0
- package/dist/primitives/places.d.ts +44 -0
- package/dist/primitives/places.js +98 -0
- package/dist/primitives/places.js.map +1 -0
- package/dist/primitives/press.d.ts +90 -0
- package/dist/primitives/press.js +153 -0
- package/dist/primitives/press.js.map +1 -0
- package/dist/primitives/report.d.ts +17 -0
- package/dist/primitives/report.js +34 -0
- package/dist/primitives/report.js.map +1 -0
- package/dist/primitives/ripple.d.ts +40 -0
- package/dist/primitives/ripple.js +70 -0
- package/dist/primitives/ripple.js.map +1 -0
- package/dist/primitives/roving.d.ts +41 -0
- package/dist/primitives/roving.js +71 -0
- package/dist/primitives/roving.js.map +1 -0
- package/dist/primitives/selection.d.ts +134 -0
- package/dist/primitives/selection.js +287 -0
- package/dist/primitives/selection.js.map +1 -0
- package/dist/primitives/separation.d.ts +28 -0
- package/dist/primitives/separation.js +96 -0
- package/dist/primitives/separation.js.map +1 -0
- package/dist/primitives/shared-choice.d.ts +33 -0
- package/dist/primitives/shared-choice.js +110 -0
- package/dist/primitives/shared-choice.js.map +1 -0
- package/dist/primitives/sheet.d.ts +63 -0
- package/dist/primitives/sheet.js +139 -0
- package/dist/primitives/sheet.js.map +1 -0
- package/dist/primitives/sheets.d.ts +8 -0
- package/dist/primitives/sheets.js +96 -0
- package/dist/primitives/sheets.js.map +1 -0
- package/dist/primitives/states.d.ts +33 -0
- package/dist/primitives/states.js +30 -0
- package/dist/primitives/states.js.map +1 -0
- package/dist/primitives/system-watch.d.ts +9 -0
- package/dist/primitives/system-watch.js +29 -0
- package/dist/primitives/system-watch.js.map +1 -0
- package/dist/primitives/target.d.ts +21 -0
- package/dist/primitives/target.js +79 -0
- package/dist/primitives/target.js.map +1 -0
- package/dist/primitives/values.d.ts +6 -0
- package/dist/primitives/values.js +22 -0
- package/dist/primitives/values.js.map +1 -0
- package/dist/primitives/visibility.d.ts +12 -0
- package/dist/primitives/visibility.js +50 -0
- package/dist/primitives/visibility.js.map +1 -0
- package/dist/primitives/words.d.ts +81 -0
- package/dist/primitives/words.js +236 -0
- package/dist/primitives/words.js.map +1 -0
- package/dist/prose.css +1917 -0
- package/dist/registry.d.ts +182 -0
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -0
- package/dist/shape.css +21 -0
- package/dist/skeleton.css +428 -0
- package/dist/steps.css +231 -0
- package/dist/steps.d.ts +6 -0
- package/dist/steps.js +156 -0
- package/dist/steps.js.map +1 -0
- package/dist/styles/icons.d.ts +62 -0
- package/dist/styles/icons.js +237 -0
- package/dist/styles/icons.js.map +1 -0
- package/dist/styles/product-text.d.ts +66 -0
- package/dist/styles/product-text.js +114 -0
- package/dist/styles/product-text.js.map +1 -0
- package/dist/styles/registered-properties.d.ts +6 -0
- package/dist/styles/registered-properties.js +68 -0
- package/dist/styles/registered-properties.js.map +1 -0
- package/dist/styles/shape.d.ts +59 -0
- package/dist/styles/shape.js +95 -0
- package/dist/styles/shape.js.map +1 -0
- package/dist/systems/cupertino.css +8793 -0
- package/dist/systems/m3-expressive-like.css +8786 -0
- package/dist/systems/m3-like.css +8748 -0
- package/dist/table-of-contents.css +482 -0
- package/dist/table.css +902 -0
- package/dist/tanrei.bundle.js +26644 -0
- package/dist/tanrei.bundle.js.map +7 -0
- package/dist/text.css +104 -0
- package/dist/timeline.css +410 -0
- package/dist/timeline.d.ts +6 -0
- package/dist/timeline.js +176 -0
- package/dist/timeline.js.map +1 -0
- package/dist/tokens.css +8801 -0
- package/dist/tree-view.css +797 -0
- package/dist/words.d.ts +2 -0
- package/dist/words.js +6 -0
- package/dist/words.js.map +1 -0
- package/package.json +132 -3
|
@@ -0,0 +1,713 @@
|
|
|
1
|
+
import { ReactiveElement } from 'lit';
|
|
2
|
+
import { displayHost, hostNodes, isExternal, pictureAddress, plainText, repeatsHost } from '../../links/index.js';
|
|
3
|
+
import { AvailabilityController, LINK_KEYS, PressController, linkRel, readDestination, readTarget, report, syncFocusStyle, watchWords, wordFor } from '../../primitives/index.js';
|
|
4
|
+
import { adopt, adoptUnlessDrawn } from '../../primitives/sheets.js';
|
|
5
|
+
const LINK_CARD_CSS = (() => {
|
|
6
|
+
try {
|
|
7
|
+
return "@layer tanrei.components {\n:where(tanrei-link-card) {\n--_lc-container: var(--tanrei-comp-link-card-outlined-container-color);\n--_lc-outline: var(--tanrei-comp-link-card-outlined-outline-color);\n--_lc-title: var(--tanrei-comp-link-card-outlined-title-color);\n--_lc-description: var(--tanrei-comp-link-card-outlined-description-color);\n--_lc-site: var(--tanrei-comp-link-card-outlined-site-color);\n--_lc-hovered-container: var(--tanrei-comp-link-card-outlined-hovered-container-color);\n--_lc-hovered-outline: var(--tanrei-comp-link-card-outlined-hovered-outline-color);\n--_lc-hovered-title: var(--tanrei-comp-link-card-outlined-hovered-title-color);\n--_lc-hovered-description: var(--tanrei-comp-link-card-outlined-hovered-description-color);\n--_lc-hovered-site: var(--tanrei-comp-link-card-outlined-hovered-site-color);\n--_lc-focused-container: var(--tanrei-comp-link-card-outlined-focused-container-color);\n--_lc-focused-outline: var(--tanrei-comp-link-card-outlined-focused-outline-color);\n--_lc-focused-title: var(--tanrei-comp-link-card-outlined-focused-title-color);\n--_lc-focused-description: var(--tanrei-comp-link-card-outlined-focused-description-color);\n--_lc-focused-site: var(--tanrei-comp-link-card-outlined-focused-site-color);\n--_lc-pressed-container: var(--tanrei-comp-link-card-outlined-pressed-container-color);\n--_lc-pressed-outline: var(--tanrei-comp-link-card-outlined-pressed-outline-color);\n--_lc-pressed-title: var(--tanrei-comp-link-card-outlined-pressed-title-color);\n--_lc-pressed-description: var(--tanrei-comp-link-card-outlined-pressed-description-color);\n--_lc-pressed-site: var(--tanrei-comp-link-card-outlined-pressed-site-color);\n--_lc-media-fill: var(--tanrei-comp-link-card-media-container-color);\n--_lc-start: left;\n--_lc-end: right;\n--_lc-mirror: 1;\n--_lc-mark: calc(1em * var(--tanrei-icons, 0));\n--_lc-mark-gap: calc(var(--tanrei-comp-link-card-site-item-gap) * var(--tanrei-icons, 0));\ndisplay: block;\nbox-sizing: border-box;\nmin-inline-size: 0;\nmax-inline-size: 100%;\ncontainer-type: inline-size;\ntext-indent: 0;\n}\n:where(tanrei-link-card[hidden]) {\ndisplay: none;\n}\n:where(tanrei-link-card):dir(rtl) {\n--_lc-start: right;\n--_lc-end: left;\n--_lc-mirror: -1;\n}\n:where(tanrei-link-card[variant='filled']) {\n--_lc-container: var(--tanrei-comp-link-card-filled-container-color);\n--_lc-outline: var(--tanrei-comp-link-card-filled-outline-color);\n--_lc-title: var(--tanrei-comp-link-card-filled-title-color);\n--_lc-description: var(--tanrei-comp-link-card-filled-description-color);\n--_lc-site: var(--tanrei-comp-link-card-filled-site-color);\n--_lc-hovered-container: var(--tanrei-comp-link-card-filled-hovered-container-color);\n--_lc-hovered-outline: var(--tanrei-comp-link-card-filled-hovered-outline-color);\n--_lc-hovered-title: var(--tanrei-comp-link-card-filled-hovered-title-color);\n--_lc-hovered-description: var(--tanrei-comp-link-card-filled-hovered-description-color);\n--_lc-hovered-site: var(--tanrei-comp-link-card-filled-hovered-site-color);\n--_lc-focused-container: var(--tanrei-comp-link-card-filled-focused-container-color);\n--_lc-focused-outline: var(--tanrei-comp-link-card-filled-focused-outline-color);\n--_lc-focused-title: var(--tanrei-comp-link-card-filled-focused-title-color);\n--_lc-focused-description: var(--tanrei-comp-link-card-filled-focused-description-color);\n--_lc-focused-site: var(--tanrei-comp-link-card-filled-focused-site-color);\n--_lc-pressed-container: var(--tanrei-comp-link-card-filled-pressed-container-color);\n--_lc-pressed-outline: var(--tanrei-comp-link-card-filled-pressed-outline-color);\n--_lc-pressed-title: var(--tanrei-comp-link-card-filled-pressed-title-color);\n--_lc-pressed-description: var(--tanrei-comp-link-card-filled-pressed-description-color);\n--_lc-pressed-site: var(--tanrei-comp-link-card-filled-pressed-site-color);\n}\n:where(tanrei-link-card) > :where(a) {\n--tanrei-corner-pill: 0;\n}\n:where(tanrei-link-card) > :where(a) {\n--_corner-scale: 1;\nborder-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale));\n}\n@supports (corner-shape: superellipse(log(2, 2))) {\n:where(tanrei-link-card) > :where(a) {\n--_corner-smoothing: calc(var(--tanrei-sys-shape-corner-smoothing, 0) * (1 - var(--tanrei-corner-pill, 0)));\n--_corner-scale: calc(1 + 0.4 * var(--_corner-smoothing));\ncorner-shape: superellipse(log(calc(2 + var(--_corner-smoothing)), 2));\n}\n}\n:where(tanrei-link-card) > :where(a) {\n--tanrei-corner-radius: var(--tanrei-comp-link-card-container-shape);\n--tanrei-corner-pill: var(--tanrei-comp-link-card-container-shape-pill, 0);\n--_lc-now-container: var(--_lc-container);\n--_lc-now-outline: var(--_lc-outline);\n--_lc-now-title: var(--_lc-title);\n--_lc-now-description: var(--_lc-description);\n--_lc-now-site: var(--_lc-site);\n--_lc-target: var(--tanrei-sys-target-pointer);\ndisplay: flex;\nflex-direction: column;\nposition: relative;\nisolation: isolate;\nbox-sizing: border-box;\nmin-inline-size: 0;\nmargin: 0;\npadding: 0;\nbackground-color: var(--_lc-now-container);\nbox-shadow: none;\ncolor: var(--_lc-now-title);\ntext-decoration: none;\n-webkit-tap-highlight-color: transparent;\ntransition:\nbackground-color var(--tanrei-comp-link-card-motion-state-duration) var(--tanrei-comp-link-card-motion-state-easing),\nopacity var(--tanrei-comp-link-card-motion-state-duration) var(--tanrei-comp-link-card-motion-state-easing);\n}\n@media (pointer: coarse) {\n:where(tanrei-link-card) > :where(a) {\n--_lc-target: var(--tanrei-sys-target-touch);\n}\n}\n:where(tanrei-link-card) > :where(a)::before {\ncontent: '';\nposition: absolute;\nz-index: 1;\ninset: 0;\nbox-sizing: border-box;\nborder: var(--tanrei-comp-link-card-outline-width) solid var(--_lc-now-outline);\nborder-radius: inherit;\ncorner-shape: inherit;\npointer-events: none;\ntransition: border-color var(--tanrei-comp-link-card-motion-state-duration) var(--tanrei-comp-link-card-motion-state-easing);\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) {\ndisplay: flex;\nflex: 1 1 auto;\nflex-direction: column;\nbox-sizing: border-box;\nmin-inline-size: 0;\nmargin: 0;\npadding: var(--tanrei-comp-link-card-container-padding);\ntext-align: var(--_lc-start);\ntransition-property: none;\ntransition-delay: var(--tanrei-sys-motion-duration-press-hold);\n}\n:where(tanrei-link-card) > :where(a:any-link) > :where([data-part='body'])::before {\ncontent: '';\nposition: absolute;\ninset-block: min(0px, calc((100% - var(--_lc-target)) / 2));\ninset-inline: min(0px, calc((100% - var(--_lc-target)) / 2));\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='title'], [data-part='description']) {\ndisplay: -webkit-box;\n-webkit-box-orient: vertical;\nbox-sizing: border-box;\noverflow: hidden;\nmin-inline-size: 0;\nmargin: 0;\npadding: 0;\ntext-align: var(--_lc-start);\nwhite-space: normal;\noverflow-wrap: anywhere;\ntransition: color var(--tanrei-comp-link-card-motion-state-duration) var(--tanrei-comp-link-card-motion-state-easing);\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='title']) {\n-webkit-line-clamp: var(--tanrei-comp-link-card-title-max-lines);\nline-clamp: var(--tanrei-comp-link-card-title-max-lines);\nfont: var(--tanrei-comp-link-card-title-typescale-font);\nletter-spacing: var(--tanrei-comp-link-card-title-typescale-letter-spacing);\ncolor: var(--_lc-now-title);\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='title'][data-address]) {\nword-break: break-all;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='description']) {\n-webkit-line-clamp: var(--tanrei-comp-link-card-description-max-lines);\nline-clamp: var(--tanrei-comp-link-card-description-max-lines);\nmargin-block-start: var(--tanrei-comp-link-card-title-gap);\nfont: var(--tanrei-comp-link-card-description-typescale-font);\nletter-spacing: var(--tanrei-comp-link-card-description-typescale-letter-spacing);\ncolor: var(--_lc-now-description);\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='description']:empty, [data-part='site']:empty) {\ndisplay: none;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='image-alt'], [data-part='words']) {\nposition: absolute;\noverflow: hidden;\ninline-size: var(--tanrei-sys-border-hairline);\nblock-size: var(--tanrei-sys-border-hairline);\nclip-path: inset(50%);\nwhite-space: nowrap;\n-webkit-user-select: none;\nuser-select: none;\npointer-events: none;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) {\ndisplay: flex;\nalign-items: flex-start;\nbox-sizing: border-box;\nmin-inline-size: 0;\nmargin: 0;\nmargin-block-start: var(--tanrei-comp-link-card-site-gap);\npadding: 0;\nfont: var(--tanrei-comp-link-card-site-typescale-font);\nletter-spacing: var(--tanrei-comp-link-card-site-typescale-letter-spacing);\ncolor: var(--_lc-now-site);\ntext-align: var(--_lc-start);\ntransition: color var(--tanrei-comp-link-card-motion-state-duration) var(--tanrei-comp-link-card-motion-state-easing);\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where(img[data-part='site-icon']) {\ndisplay: block;\nflex: none;\nbox-sizing: border-box;\ninline-size: var(--tanrei-comp-link-card-site-icon-size);\nblock-size: var(--tanrei-comp-link-card-site-icon-size);\nmax-inline-size: none;\nmargin-block: calc((1lh - var(--tanrei-comp-link-card-site-icon-size)) / 2);\nmargin-inline: 0 var(--tanrei-comp-link-card-site-item-gap);\nborder-radius: calc(var(--tanrei-comp-link-card-site-icon-shape) * var(--_corner-scale, 1));\ncorner-shape: inherit;\nobject-fit: contain;\n-webkit-user-select: none;\nuser-select: none;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']) {\n--_lc-dot: 0;\n--_lc-dot-room: calc(var(--tanrei-comp-link-card-site-item-gap) + (var(--tanrei-comp-link-card-site-item-gap) + 1ch) * var(--_lc-dot));\ndisplay: flex;\nflex: 0 99999 auto;\nflex-wrap: wrap;\nbox-sizing: border-box;\noverflow: hidden;\nmin-inline-size: 0;\nblock-size: 1lh;\nmargin: 0;\npadding: 0;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']:has(+ [data-part='address'] > [data-part='host'])) {\n--_lc-dot: 1;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']:empty, [data-part='site-name'][data-undrawn]) {\ndisplay: none;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name'])::before {\ncontent: '';\nflex: none;\ninline-size: 0;\nblock-size: 100%;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']) > :where(span) {\ndisplay: block;\nposition: relative;\nflex: 1 1 0%;\nbox-sizing: border-box;\noverflow: hidden;\nmin-inline-size: calc(2em + var(--_lc-dot-room));\npadding-block: 0;\npadding-inline: 0;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n:where(tanrei-link-card):not(:dir(rtl)) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']) > :where(span) {\npadding-right: var(--_lc-dot-room);\n}\n:where(tanrei-link-card):dir(rtl) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']) > :where(span) {\npadding-left: var(--_lc-dot-room);\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']) > :where(span)::after {\ncontent: '\\00B7';\ncontent: '\\00B7' / '';\nposition: absolute;\ninset-block-start: 0;\ninline-size: 1ch;\ntext-align: center;\nopacity: var(--_lc-dot);\n}\n:where(tanrei-link-card):not(:dir(rtl)) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']) > :where(span)::after {\nright: var(--tanrei-comp-link-card-site-item-gap);\n}\n:where(tanrei-link-card):dir(rtl) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='site-name']) > :where(span)::after {\nleft: var(--tanrei-comp-link-card-site-item-gap);\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='address']) {\ndisplay: block;\nflex: 0 1 auto;\nbox-sizing: border-box;\nmin-inline-size: 0;\nmargin: 0;\npadding: 0;\ntext-align: var(--_lc-start);\nwhite-space: normal;\noverflow-wrap: anywhere;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='address']) > :where([data-part='host']) {\ndirection: ltr;\nunicode-bidi: isolate;\n}\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='address']) > :where([data-part='host']) > :where(span:not(:last-child))::after {\ncontent: '\\200B';\ncontent: '\\200B' / '';\n}\n:where(tanrei-link-card) > :where(a:any-link:is([target='_blank' i], [data-external]:not([data-external='false']))) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='address'])::after {\ncontent: 'arrow_outward';\ncontent: 'arrow_outward' / '';\ndisplay: inline-block;\noverflow: hidden;\ninline-size: var(--_lc-mark);\nblock-size: 1em;\nvertical-align: middle;\nfont-family: var(--tanrei-sys-icon-family-unselected);\nfont-size: 1em;\nfont-style: normal;\nfont-weight: normal;\nline-height: 1;\nletter-spacing: normal;\ntext-transform: none;\nwhite-space: nowrap;\nword-wrap: normal;\ndirection: ltr;\n-webkit-user-select: none;\nuser-select: none;\npointer-events: none;\nfont-feature-settings: 'liga';\n-webkit-font-smoothing: antialiased;\nfont-optical-sizing: auto;\nfont-variation-settings:\n'FILL' var(--tanrei-sys-icon-fill-unselected),\n'wght' var(--tanrei-sys-icon-weight),\n'GRAD' 0;\nopacity: var(--tanrei-icons, 0);\ntransform: scaleX(var(--_lc-mirror));\n}\n@supports (font-variation-settings: 'opsz' tan(atan2(1em, 1px))) {\n:where(tanrei-link-card) > :where(a:any-link:is([target='_blank' i], [data-external]:not([data-external='false']))) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='address'])::after {\nfont-variation-settings: 'FILL' var(--tanrei-sys-icon-fill-unselected), 'wght' var(--tanrei-sys-icon-weight), 'GRAD' 0, 'opsz' clamp(var(--tanrei-sys-icon-optical-size-min), tan(atan2(1em, 1px)), var(--tanrei-sys-icon-optical-size-max));\n}\n}\n:where(tanrei-link-card) > :where(a:any-link:is([target='_blank' i], [data-external]:not([data-external='false']))) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='address']:not(:empty))::after {\nmargin-inline-start: var(--_lc-mark-gap);\n}\n:where(tanrei-link-card) > :where(a:any-link[target='_blank' i]) > :where([data-part='body']) > :where([data-part='site']) > :where([data-part='address'])::after {\ncontent: 'open_in_new';\ncontent: 'open_in_new' / '';\n}\n:where(tanrei-link-card) > :where(a) > :where(img[data-part='media']) {\ndisplay: block;\norder: -1;\nflex: none;\nbox-sizing: border-box;\ninline-size: 100%;\nmax-inline-size: none;\nblock-size: auto;\naspect-ratio: var(--tanrei-comp-link-card-media-aspect-ratio);\nmargin: 0;\npadding: 0;\nborder: 0;\nbackground-color: var(--_lc-media-fill);\nobject-fit: cover;\nobject-position: center;\nborder-start-start-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale, 1));\nborder-start-end-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale, 1));\ncorner-shape: inherit;\n-webkit-user-select: none;\nuser-select: none;\n}\n@container (inline-size >= 30rem) {\n:where(tanrei-link-card) > :where(a:has(> img[data-part='media'])) {\npadding-inline-end: var(--tanrei-comp-link-card-media-width);\n}\n:where(tanrei-link-card) > :where(a) > :where(img[data-part='media']) {\nposition: absolute;\ninset-block: 0;\ninset-inline-end: 0;\ninline-size: var(--tanrei-comp-link-card-media-width);\nblock-size: 100%;\naspect-ratio: auto;\nborder-start-start-radius: 0;\nborder-end-end-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale, 1));\n}\n}\n@media (hover: hover) {\n:where(tanrei-link-card) > :where(a:any-link:hover) {\n--_lc-now-container: var(--_lc-hovered-container);\n--_lc-now-outline: var(--_lc-hovered-outline);\n--_lc-now-title: var(--_lc-hovered-title);\n--_lc-now-description: var(--_lc-hovered-description);\n--_lc-now-site: var(--_lc-hovered-site);\nopacity: var(--tanrei-comp-link-card-hovered-opacity);\n}\n}\n:where(tanrei-link-card) > :where(a:any-link:focus-visible) {\n--_lc-now-container: var(--_lc-focused-container);\n--_lc-now-outline: var(--_lc-focused-outline);\n--_lc-now-title: var(--_lc-focused-title);\n--_lc-now-description: var(--_lc-focused-description);\n--_lc-now-site: var(--_lc-focused-site);\n--_lc-focus-inner-edge: calc(var(--tanrei-sys-focus-offset) + var(--tanrei-sys-focus-inner-width));\nopacity: var(--tanrei-comp-link-card-focused-opacity);\noutline: var(--tanrei-sys-focus-outer-width) solid var(--tanrei-sys-color-focus-ring);\noutline-offset: var(--_lc-focus-inner-edge);\n}\n:where(tanrei-link-card) > :where(a:any-link:focus-visible)::after {\ncontent: '';\nposition: absolute;\ninset: calc(var(--_lc-focus-inner-edge) * -1);\nborder: var(--tanrei-sys-focus-inner-width) solid var(--tanrei-sys-color-focus-ring-inner);\nborder-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale, 1) + var(--_lc-focus-inner-edge));\ncorner-shape: inherit;\npointer-events: none;\n}\n@container style(--tanrei-sys-behavior-focus-style: glow) {\n:where(tanrei-link-card) > :where(a:any-link:focus-visible) {\noutline-color: transparent;\n}\n:where(tanrei-link-card) > :where(a:any-link:focus-visible)::after {\ninset: calc(var(--tanrei-sys-focus-offset) * -1);\nborder: 0;\nborder-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale, 1) + var(--tanrei-sys-focus-offset));\nbox-shadow:\n0 0 var(--tanrei-sys-focus-inner-width) var(--tanrei-sys-focus-inner-width) var(--tanrei-sys-color-focus-ring-inner),\n0 0 var(--tanrei-sys-focus-outer-width) calc(var(--tanrei-sys-focus-inner-width) + var(--tanrei-sys-focus-outer-width)) var(--tanrei-sys-color-focus-ring);\n}\n}\n:where(tanrei-link-card) > :where(a:any-link[data-focus-style='glow']:focus-visible) {\noutline-color: transparent;\n}\n:where(tanrei-link-card) > :where(a:any-link[data-focus-style='glow']:focus-visible)::after {\ninset: calc(var(--tanrei-sys-focus-offset) * -1);\nborder: 0;\nborder-radius: calc(var(--tanrei-corner-radius) * var(--_corner-scale, 1) + var(--tanrei-sys-focus-offset));\nbox-shadow:\n0 0 var(--tanrei-sys-focus-inner-width) var(--tanrei-sys-focus-inner-width) var(--tanrei-sys-color-focus-ring-inner),\n0 0 var(--tanrei-sys-focus-outer-width) calc(var(--tanrei-sys-focus-inner-width) + var(--tanrei-sys-focus-outer-width)) var(--tanrei-sys-color-focus-ring);\n}\n:where(tanrei-link-card) > :where(a:any-link:active:not([data-pressed])) {\n--_lc-now-container: var(--_lc-pressed-container);\n--_lc-now-outline: var(--_lc-pressed-outline);\n--_lc-now-title: var(--_lc-pressed-title);\n--_lc-now-description: var(--_lc-pressed-description);\n--_lc-now-site: var(--_lc-pressed-site);\nopacity: var(--tanrei-comp-link-card-pressed-opacity);\ntransition-duration: 0s;\n}\n:where(tanrei-link-card) > :where(a[data-pressed]:not([data-pressed='none'])) {\ntransition-duration: 0s;\n}\n:where(tanrei-link-card) > :where(a[data-pressed='overlay']) {\n--_lc-now-container: var(--_lc-pressed-container);\n}\n:where(tanrei-link-card) > :where(a:is([data-pressed='overlay'], [data-pressed='ripple'], [data-pressed='dim'])) {\n--_lc-now-outline: var(--_lc-pressed-outline);\n--_lc-now-title: var(--_lc-pressed-title);\n--_lc-now-description: var(--_lc-pressed-description);\n--_lc-now-site: var(--_lc-pressed-site);\nopacity: var(--tanrei-comp-link-card-pressed-opacity);\n}\n:where(tanrei-link-card) > :where(a) > :where(.ripple) {\nposition: absolute;\nz-index: -1;\ninset: 0;\nborder-radius: inherit;\ncorner-shape: inherit;\nbackground: var(--_lc-pressed-container);\npointer-events: none;\nclip-path: circle(var(--_r) at var(--_x) var(--_y));\nanimation: tanrei-link-card-ripple var(--tanrei-comp-link-card-motion-feedback-duration) var(--tanrei-comp-link-card-motion-state-easing) both;\ntransition: opacity var(--tanrei-comp-link-card-motion-state-duration) var(--tanrei-comp-link-card-motion-state-easing);\n}\n:where(tanrei-link-card) > :where(a) > :where(.ripple.leaving) {\nopacity: 0;\n}\n@keyframes tanrei-link-card-ripple {\nfrom {\nclip-path: circle(0 at var(--_x) var(--_y));\n}\n}\n@media (prefers-reduced-motion: reduce) {\n:where(tanrei-link-card) > :where(a),\n:where(tanrei-link-card) > :where(a)::before,\n:where(tanrei-link-card) > :where(a) > :where([data-part='body']) > :where([data-part='title'], [data-part='description'], [data-part='site']) {\ntransition: none;\n}\n:where(tanrei-link-card) > :where(a) > :where(.ripple) {\nanimation: none;\ntransition: none;\n}\n}\n@media (forced-colors: active) {\n:where(tanrei-link-card) {\n--_lc-media-fill: transparent;\n}\n:where(tanrei-link-card) > :where(a:any-link) {\n--_lc-now-outline: CanvasText;\n--_lc-now-title: LinkText;\n--_lc-now-description: CanvasText;\n--_lc-now-site: CanvasText;\n}\n:where(tanrei-link-card) > :where(a:any-link:focus-visible) {\noutline-color: Highlight;\n}\n}\n:where(tanrei-link-card:has(> a:is(:not(:any-link), [href=''], [href^='javascript:' i]))) {\ndisplay: inline;\ncontainer-type: normal;\n}\n:where(tanrei-link-card) > :where(a:is(:not(:any-link), [href=''], [href^='javascript:' i])) {\ndisplay: inline;\nposition: static;\npadding: 0;\nborder-radius: 0;\nbackground-color: transparent;\ncolor: inherit;\nopacity: unset;\noutline: none;\ncursor: inherit;\ntransition: none;\n}\n:where(tanrei-link-card) > :where(a:is(:not(:any-link), [href=''], [href^='javascript:' i]))::before,\n:where(tanrei-link-card) > :where(a:is(:not(:any-link), [href=''], [href^='javascript:' i]))::after {\ncontent: none;\n}\n:where(tanrei-link-card) > :where(a:is(:not(:any-link), [href=''], [href^='javascript:' i])) > :where(*) {\ndisplay: none;\n}\n:where(tanrei-link-card) > :where(a:is(:not(:any-link), [href=''], [href^='javascript:' i])) > :where([data-part='body']) {\ndisplay: inline;\npadding: 0;\ntext-align: inherit;\n}\n:where(tanrei-link-card) > :where(a:is(:not(:any-link), [href=''], [href^='javascript:' i])) > :where([data-part='body']) > :where(*) {\ndisplay: none;\n}\n:where(tanrei-link-card) > :where(a:is(:not(:any-link), [href=''], [href^='javascript:' i])) > :where([data-part='body']) > :where([data-part='title']) {\ndisplay: inline;\noverflow: visible;\nfont: inherit;\nletter-spacing: inherit;\ncolor: inherit;\ntext-align: inherit;\nword-break: inherit;\noverflow-wrap: inherit;\ntransition: none;\n}\n}";
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
13
|
+
const TAG = 'tanrei-link-card';
|
|
14
|
+
const PREFIX = '--tanrei-comp-link-card';
|
|
15
|
+
const CORE_VARIANTS = ['outlined', 'filled'];
|
|
16
|
+
const DEFAULT_VARIANT = 'outlined';
|
|
17
|
+
const EXTERNALS = ['auto', 'on', 'off'];
|
|
18
|
+
/** Attribute values are interpolated into CSS: only token-name characters are accepted. */
|
|
19
|
+
const KEY = /^[a-z0-9][a-z0-9-]*$/;
|
|
20
|
+
/** What a look paints, at rest and in each state (the names link-card.css reads). */
|
|
21
|
+
const PAINTS = ['container', 'outline', 'title', 'description', 'site'];
|
|
22
|
+
const STATES = ['', 'hovered-', 'focused-', 'pressed-'];
|
|
23
|
+
/** The one value `data-external` holds when this element found the destination external; only it is ever taken back. */
|
|
24
|
+
const DETECTED = 'detected';
|
|
25
|
+
/** LKC-35: what takes focus or is pressed by itself. */
|
|
26
|
+
const INTERACTIVE = 'a, button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [tabindex], [contenteditable]:not([contenteditable="false"]), [role="button"], [role="link"]';
|
|
27
|
+
/** The parts of the body and of the site line, in the order they stand. */
|
|
28
|
+
const BODY_ORDER = ['title', 'description', 'image-alt', 'site', 'words'];
|
|
29
|
+
const SITE_ORDER = ['site-icon', 'site-name', 'address'];
|
|
30
|
+
const sheets = new Map();
|
|
31
|
+
/** A stylesheet of the page, made once and shared by every root that needs it. */
|
|
32
|
+
function sheet(id, text) {
|
|
33
|
+
if (typeof CSSStyleSheet === 'undefined')
|
|
34
|
+
return null;
|
|
35
|
+
let made = sheets.get(id);
|
|
36
|
+
if (!made) {
|
|
37
|
+
made = new CSSStyleSheet();
|
|
38
|
+
try {
|
|
39
|
+
made.replaceSync(text());
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// A browser that cannot construct it: the page's own copy of link-card.css draws the card.
|
|
43
|
+
}
|
|
44
|
+
sheets.set(id, made);
|
|
45
|
+
}
|
|
46
|
+
return made;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* LKC-27: a look a design system added — each paint from that look's tokens, falling back to the default's.
|
|
50
|
+
* In no cascade layer, so that it also wins over a copy of link-card.css a page loads into a layer of its own.
|
|
51
|
+
*/
|
|
52
|
+
const variantRules = (variant) => `:where(${TAG}[variant='${variant}']) { ${STATES.flatMap((state) => PAINTS.map((paint) => `--_lc-${state}${paint}: var(${PREFIX}-${variant}-${state}${paint}-color, var(${PREFIX}-${DEFAULT_VARIANT}-${state}${paint}-color));`)).join(' ')} }`;
|
|
53
|
+
/** Writes an attribute only when it differs: what is written here is observed, and must settle. */
|
|
54
|
+
function mark(element, name, value) {
|
|
55
|
+
if (value === null) {
|
|
56
|
+
if (element.hasAttribute(name))
|
|
57
|
+
element.removeAttribute(name);
|
|
58
|
+
}
|
|
59
|
+
else if (element.getAttribute(name) !== value)
|
|
60
|
+
element.setAttribute(name, value);
|
|
61
|
+
}
|
|
62
|
+
/** Writes text only when it differs — as a text node, never as markup (LKC-15). */
|
|
63
|
+
function say(element, text) {
|
|
64
|
+
if (element.textContent !== text)
|
|
65
|
+
element.textContent = text;
|
|
66
|
+
}
|
|
67
|
+
const SETTINGS = Symbol.for('tanrei.link-settings');
|
|
68
|
+
function linkSettings() {
|
|
69
|
+
const holder = globalThis;
|
|
70
|
+
return (holder[SETTINGS] ??= { site: [], reread: new Set() });
|
|
71
|
+
}
|
|
72
|
+
let cards = 0;
|
|
73
|
+
/**
|
|
74
|
+
* One link drawn as a block: the destination's title, a sentence about it, its picture and the site it is on — from
|
|
75
|
+
* values the card is given and never loads. The host under the text is always computed from `href`.
|
|
76
|
+
*
|
|
77
|
+
* Contract: specs/link-card.spec.json. The element has **no shadow root**: it is the box around the product's own
|
|
78
|
+
* anchor, which stays in the document — a link before any script runs, for a crawler, a reader mode and the browser's
|
|
79
|
+
* own menu (LKC-1).
|
|
80
|
+
*
|
|
81
|
+
* ```html
|
|
82
|
+
* <tanrei-link-card>
|
|
83
|
+
* <a href="https://example.com/articles/designing-with-tokens">
|
|
84
|
+
* <span data-part="body">
|
|
85
|
+
* <span data-part="title" dir="auto">Designing with tokens</span>
|
|
86
|
+
* <span data-part="description" dir="auto">How a handful of dials becomes a whole system.</span>
|
|
87
|
+
* <span data-part="site">
|
|
88
|
+
* <img data-part="site-icon" src="/link-pictures/icon.png" alt="" loading="lazy" decoding="async" referrerpolicy="no-referrer">
|
|
89
|
+
* <span data-part="site-name"><span dir="auto">Example Journal</span></span>
|
|
90
|
+
* <span data-part="address"><bdi data-part="host" dir="ltr">example.com</bdi></span>
|
|
91
|
+
* </span>
|
|
92
|
+
* </span>
|
|
93
|
+
* <img data-part="media" src="/link-pictures/picture.png" alt="" width="1200" height="630" loading="lazy" decoding="async" referrerpolicy="no-referrer">
|
|
94
|
+
* </a>
|
|
95
|
+
* </tanrei-link-card>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* That markup is what `linkCardToNodes()` / `linkCardToHtml()` of `@tanrei/web/links/node` write where a site is built;
|
|
99
|
+
* `@tanrei/web/link-card.css` draws all of it before and without this script, so a page of link cards does not move
|
|
100
|
+
* when the script arrives (LKC-36). The script adds what a document cannot hold: the host computed anew from `href`
|
|
101
|
+
* (one written in the document that differs is replaced, and reported), the title as the link's name and the other
|
|
102
|
+
* parts as its description, `data-external` where the page was not marked, a picture that fails taken away, the
|
|
103
|
+
* shared press primitive, and the debug reports.
|
|
104
|
+
*
|
|
105
|
+
* **A card the element builds.** A `<tanrei-link-card>` that holds no anchor is given one from its attributes —
|
|
106
|
+
* `href`, `headline`, `description`, `image`, `image-alt`, `site-name`, `site-icon`, `target`, `target-label`,
|
|
107
|
+
* `external`, `external-label` — each value cleaned and written as text, never as markup (LKC-15). That form is drawn
|
|
108
|
+
* when the element is defined, not before. Where the element holds the product's own anchor, an attribute that is
|
|
109
|
+
* given is written over that anchor's part and one that is not leaves the markup as it is.
|
|
110
|
+
*
|
|
111
|
+
* **It requests nothing about the destination** (LKC-14): no address is derived from `href`, and the only requests are
|
|
112
|
+
* the two pictures it was given, each an `<img>` asked for without the page's address.
|
|
113
|
+
*
|
|
114
|
+
* @tag tanrei-link-card
|
|
115
|
+
* @slot - The product's own anchor, holding the parts (`data-part`: `body` around `title`, `description`, `image-alt`, `site` and `words`; then `media`). A child in the document, not a slotted node: the element has no shadow root. Nothing in it is pressed by itself (LKC-35).
|
|
116
|
+
* @fires click - The anchor's own `click`, before the destination opens; cancelling it cancels the navigation (a client-side router takes it).
|
|
117
|
+
*/
|
|
118
|
+
export class TanreiLinkCard extends ReactiveElement {
|
|
119
|
+
constructor() {
|
|
120
|
+
super(...arguments);
|
|
121
|
+
this.availability = new AvailabilityController(this, 'link-card');
|
|
122
|
+
/** The destination, as an anchor takes it: a URL, a path or a fragment. It is also the one thing the host is read from. Empty, a script, or unreadable: the card is not a link and is not drawn as a card. */
|
|
123
|
+
this.href = '';
|
|
124
|
+
/** Where the destination opens: `same` (where the person is) or `new` (a new tab or window, marked with open_in_new and said through `targetLabel`). HTML's `_blank` and `_self` are read as the two. */
|
|
125
|
+
this.target = 'same';
|
|
126
|
+
/** What assistive technology reads at the end of the card's description while `target` is `new` ("opens in a new tab"), in the product's language. Tanrei ships no words. */
|
|
127
|
+
this.targetLabel = '';
|
|
128
|
+
/** Whether the destination is on another site: `auto` decides as the Link does (the address against the page's origin and `setSiteOrigins()`), `on` and `off` say so. An external card that opens where the person is draws arrow_outward. */
|
|
129
|
+
this.external = 'auto';
|
|
130
|
+
/** What assistive technology reads at the end of the description while the destination is external and `target` is `same` ("external link"). Empty, the words set once with `setExternalLabel()` are read. */
|
|
131
|
+
this.externalLabel = '';
|
|
132
|
+
/** The destination's title; the card's accessible name. Plain text, on at most `comp.link-card.title.max-lines` lines. Empty, the address is drawn in its place. (`headline`, because HTML's global `title` would show a tooltip over the whole card.) */
|
|
133
|
+
this.headline = '';
|
|
134
|
+
/** A sentence or two about the destination. Plain text; the first part of the card's description. */
|
|
135
|
+
this.description = '';
|
|
136
|
+
/** The address of a picture that stands for the destination: beside the text in a wide card, above it in a narrow one. The card asks for this address, as a picture, and for nothing else about the destination. */
|
|
137
|
+
this.image = '';
|
|
138
|
+
/** What the picture shows, where that is worth saying. Never drawn; read as part of the description. Empty, the picture is decoration. */
|
|
139
|
+
this.imageAlt = '';
|
|
140
|
+
/** What the destination's site calls itself. Drawn before the host, cut first, never in the host's place; not drawn where it only repeats the host. */
|
|
141
|
+
this.siteName = '';
|
|
142
|
+
/** The address of the destination site's small icon, given to the card and never looked up by it. */
|
|
143
|
+
this.siteIcon = '';
|
|
144
|
+
/** How the card is set apart: `outlined` is the surface inside one hairline, `filled` a tone of the surface and no edge. A design system may add values. */
|
|
145
|
+
this.variant = 'outlined';
|
|
146
|
+
this.serial = ++cards;
|
|
147
|
+
this.mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver((records) => this.changed(records));
|
|
148
|
+
/** Whether the anchor is one this element wrote (a card built from attributes): then every part is the properties'. */
|
|
149
|
+
this.built = false;
|
|
150
|
+
/** What this element wrote on the anchor, so that only that is ever taken off again. */
|
|
151
|
+
this.given = new Set();
|
|
152
|
+
this.wroteExternal = null;
|
|
153
|
+
this.wroteTarget = false;
|
|
154
|
+
/** The words part and the host part this element wrote: what the document holds otherwise is the product's. */
|
|
155
|
+
this.ownWords = null;
|
|
156
|
+
this.productWords = '';
|
|
157
|
+
this.ownHost = null;
|
|
158
|
+
/** The addresses of pictures that could not be loaded: none is asked for again until the product gives it anew. */
|
|
159
|
+
this.refused = new Set();
|
|
160
|
+
/** The anchor the press primitive answers for. */
|
|
161
|
+
this.pressed = null;
|
|
162
|
+
this.press = new PressController(this, {
|
|
163
|
+
container: () => this.pressed ?? this.anchor(),
|
|
164
|
+
// The body's transition delay is press-hold as a time (link-card.css); nothing of it transitions.
|
|
165
|
+
holdCarrier: () => (this.pressed ?? this.anchor())?.querySelector(':scope > [data-part="body"]') ?? null,
|
|
166
|
+
disabled: () => !(this.pressed ?? this.anchor())?.hasAttribute('href'),
|
|
167
|
+
// LKC-22: Enter, never Space.
|
|
168
|
+
keys: LINK_KEYS,
|
|
169
|
+
});
|
|
170
|
+
this.reread = () => this.read();
|
|
171
|
+
/** The product's words changed: the words of a new context and of another site are read again. */
|
|
172
|
+
this.unwatchWords = null;
|
|
173
|
+
this.waiting = false;
|
|
174
|
+
this.onPicture = (event) => {
|
|
175
|
+
const picture = event.target;
|
|
176
|
+
if (!(picture instanceof HTMLImageElement) || !this.own(event))
|
|
177
|
+
return;
|
|
178
|
+
const part = picture.getAttribute('data-part');
|
|
179
|
+
if (part !== 'media' && part !== 'site-icon')
|
|
180
|
+
return;
|
|
181
|
+
if (event.type === 'error')
|
|
182
|
+
this.failed(picture, part === 'media' ? 'image' : 'siteIcon', part === 'media' ? 'LKC-13' : 'LKC-10');
|
|
183
|
+
this.read();
|
|
184
|
+
};
|
|
185
|
+
this.release = () => {
|
|
186
|
+
this.press.release();
|
|
187
|
+
};
|
|
188
|
+
/** Listened for on the element, on the way down: the anchor and its parts are the document's, and get no listener of their own. */
|
|
189
|
+
this.listeners = [
|
|
190
|
+
['error', this.onPicture],
|
|
191
|
+
['load', this.onPicture],
|
|
192
|
+
[
|
|
193
|
+
'pointerdown',
|
|
194
|
+
(event) => {
|
|
195
|
+
const anchor = this.own(event);
|
|
196
|
+
if (!anchor?.hasAttribute('href'))
|
|
197
|
+
return;
|
|
198
|
+
this.pressed = anchor;
|
|
199
|
+
this.press.onPointerDown(event);
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
['pointerup', this.release],
|
|
203
|
+
['pointercancel', this.release],
|
|
204
|
+
// (It does not bubble, and is heard here for every part: the press ends when the pointer leaves the anchor itself.)
|
|
205
|
+
['pointerleave', (event) => event.target === this.pressed && this.release()],
|
|
206
|
+
['dragstart', this.release],
|
|
207
|
+
[
|
|
208
|
+
'keydown',
|
|
209
|
+
(event) => {
|
|
210
|
+
const anchor = this.own(event);
|
|
211
|
+
if (!anchor?.hasAttribute('href') || event.target !== anchor)
|
|
212
|
+
return;
|
|
213
|
+
this.pressed = anchor;
|
|
214
|
+
this.press.onKeyDown(event);
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
['keyup', (event) => this.press.onKeyUp(event)],
|
|
218
|
+
[
|
|
219
|
+
'focusin',
|
|
220
|
+
(event) => {
|
|
221
|
+
const anchor = this.own(event);
|
|
222
|
+
// LKC-20: sys.behavior.focus-style, read when focus arrives, where the browser has no style queries.
|
|
223
|
+
if (anchor)
|
|
224
|
+
syncFocusStyle(this, anchor);
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
['focusout', () => this.press.onBlur()],
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
static { this.properties = {
|
|
231
|
+
href: { type: String },
|
|
232
|
+
target: { type: String },
|
|
233
|
+
targetLabel: { type: String, attribute: 'target-label' },
|
|
234
|
+
external: { type: String },
|
|
235
|
+
externalLabel: { type: String, attribute: 'external-label' },
|
|
236
|
+
headline: { type: String },
|
|
237
|
+
description: { type: String },
|
|
238
|
+
image: { type: String },
|
|
239
|
+
imageAlt: { type: String, attribute: 'image-alt' },
|
|
240
|
+
siteName: { type: String, attribute: 'site-name' },
|
|
241
|
+
siteIcon: { type: String, attribute: 'site-icon' },
|
|
242
|
+
// The default is not reflected: a card that is defined is the card that was written.
|
|
243
|
+
variant: { type: String, reflect: true, useDefault: true },
|
|
244
|
+
}; }
|
|
245
|
+
/** No shadow root: the anchor is the document's. */
|
|
246
|
+
createRenderRoot() {
|
|
247
|
+
return this;
|
|
248
|
+
}
|
|
249
|
+
connectedCallback() {
|
|
250
|
+
super.connectedCallback();
|
|
251
|
+
adoptUnlessDrawn(this, sheet('link-card', () => LINK_CARD_CSS), '--_lc-container');
|
|
252
|
+
this.mutations?.observe(this, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ['href', 'target', 'src', 'data-external'] });
|
|
253
|
+
for (const [type, listener] of this.listeners)
|
|
254
|
+
this.addEventListener(type, listener, true);
|
|
255
|
+
linkSettings().reread?.add(this.reread);
|
|
256
|
+
this.unwatchWords = watchWords(this.reread);
|
|
257
|
+
if (this.hasUpdated)
|
|
258
|
+
this.read();
|
|
259
|
+
}
|
|
260
|
+
disconnectedCallback() {
|
|
261
|
+
super.disconnectedCallback();
|
|
262
|
+
this.mutations?.disconnect();
|
|
263
|
+
for (const [type, listener] of this.listeners)
|
|
264
|
+
this.removeEventListener(type, listener, true);
|
|
265
|
+
linkSettings().reread?.delete(this.reread);
|
|
266
|
+
this.unwatchWords?.();
|
|
267
|
+
this.unwatchWords = null;
|
|
268
|
+
this.pressed = null;
|
|
269
|
+
}
|
|
270
|
+
updated(changed) {
|
|
271
|
+
if (changed.has('variant'))
|
|
272
|
+
this.readVariant();
|
|
273
|
+
// LKC-27: an external the card does not define is auto.
|
|
274
|
+
if (changed.has('external') && !EXTERNALS.includes(String(this.external ?? 'auto'))) {
|
|
275
|
+
report(this, 'LKC-27', `external "${this.external}" is not a value the link card defines ("auto", "on" or "off"); the address decides`);
|
|
276
|
+
}
|
|
277
|
+
if (changed.has('target') && !readTarget(this.target).known) {
|
|
278
|
+
report(this, 'LKC-27', `target "${this.target}" is not a value the link card defines ("same" or "new"); it opens where the person is`);
|
|
279
|
+
}
|
|
280
|
+
// LKC-13: a picture whose address changed is a new picture — its box is drawn until it has loaded.
|
|
281
|
+
this.read(changed.has('image'), changed.has('siteIcon'));
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* LKC-27: a look the core does not have was added by a design system — its rule is added to the root, falling back
|
|
285
|
+
* to the default's tokens — or is unknown to the active one, which a debug build says.
|
|
286
|
+
*/
|
|
287
|
+
readVariant() {
|
|
288
|
+
const variant = String(this.variant ?? '');
|
|
289
|
+
if (CORE_VARIANTS.includes(variant))
|
|
290
|
+
return;
|
|
291
|
+
const known = KEY.test(variant);
|
|
292
|
+
if (known)
|
|
293
|
+
adopt(this.getRootNode(), sheet(`variant:${variant}`, () => variantRules(variant)));
|
|
294
|
+
if (!known || getComputedStyle(this).getPropertyValue(`${PREFIX}-${variant}-container-color`).trim() === '') {
|
|
295
|
+
report(this, 'LKC-27', `variant "${variant}" is not a value of the active design system; it is drawn as "${DEFAULT_VARIANT}"`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
anchor() {
|
|
299
|
+
return this.querySelector(':scope > a');
|
|
300
|
+
}
|
|
301
|
+
/** What changed inside the card: everything is read again, unless it was only the ripple's own layer. */
|
|
302
|
+
changed(records) {
|
|
303
|
+
const ripple = (node) => node instanceof Element && node.classList.contains('ripple');
|
|
304
|
+
if (records.every((record) => record.type === 'childList' && [...record.addedNodes, ...record.removedNodes].every(ripple)))
|
|
305
|
+
return;
|
|
306
|
+
this.read();
|
|
307
|
+
}
|
|
308
|
+
/** A part of `parent` by its name, made in its place among the others where it is missing. */
|
|
309
|
+
partOf(parent, id, order, name = 'span') {
|
|
310
|
+
const found = parent.querySelector(`:scope > [data-part="${id}"]`);
|
|
311
|
+
if (found)
|
|
312
|
+
return found;
|
|
313
|
+
const made = document.createElement(name);
|
|
314
|
+
made.setAttribute('data-part', id);
|
|
315
|
+
const later = order.slice(order.indexOf(id) + 1).map((next) => parent.querySelector(`:scope > [data-part="${next}"]`)).find(Boolean);
|
|
316
|
+
if (later)
|
|
317
|
+
later.before(made);
|
|
318
|
+
else
|
|
319
|
+
parent.append(made);
|
|
320
|
+
return made;
|
|
321
|
+
}
|
|
322
|
+
drop(parent, id) {
|
|
323
|
+
parent?.querySelector(`:scope > [data-part="${id}"]`)?.remove();
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Reads the card and writes what follows from it: the anchor and the parts the properties ask for, then what a
|
|
327
|
+
* document cannot hold — the host, the marks, the name and the description, the pictures' attributes and failures.
|
|
328
|
+
* Called when a property changes and when the card's content does (LKC-34); it writes only what differs, so it
|
|
329
|
+
* settles. It asks the network for nothing (LKC-14): the only addresses it writes are the two pictures it was given.
|
|
330
|
+
*/
|
|
331
|
+
read(newImage = false, newIcon = false) {
|
|
332
|
+
if (!this.isConnected)
|
|
333
|
+
return;
|
|
334
|
+
let anchor = this.anchor();
|
|
335
|
+
const asked = !!(this.href || this.headline);
|
|
336
|
+
if (!anchor) {
|
|
337
|
+
if (!asked)
|
|
338
|
+
return;
|
|
339
|
+
// A card that is still being parsed may yet hold the product's own anchor: it is read again when it is whole.
|
|
340
|
+
if (document.readyState === 'loading') {
|
|
341
|
+
if (!this.waiting) {
|
|
342
|
+
this.waiting = true;
|
|
343
|
+
document.addEventListener('DOMContentLoaded', () => ((this.waiting = false), this.read()), { once: true });
|
|
344
|
+
}
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
anchor = this.appendChild(document.createElement('a'));
|
|
348
|
+
this.built = true;
|
|
349
|
+
}
|
|
350
|
+
this.write(anchor, newImage, newIcon);
|
|
351
|
+
this.enhance(anchor);
|
|
352
|
+
// What was written here is not a change to read again.
|
|
353
|
+
this.mutations?.takeRecords();
|
|
354
|
+
}
|
|
355
|
+
/** Whether a property speaks for its part: always in a card the element built, and where it is given otherwise. */
|
|
356
|
+
speaks(value, unset = '') {
|
|
357
|
+
return this.built || (value ?? unset) !== unset;
|
|
358
|
+
}
|
|
359
|
+
/** The properties, written into the anchor and its parts — each value cleaned, each written as text (LKC-15). */
|
|
360
|
+
write(anchor, newImage, newIcon) {
|
|
361
|
+
if (this.speaks(this.href)) {
|
|
362
|
+
const { href, refusal } = readDestination(this.href);
|
|
363
|
+
mark(anchor, 'href', href);
|
|
364
|
+
if (href === null && this.href.trim()) {
|
|
365
|
+
report(this, 'LKC-27', refusal === 'script' ? 'href names a script to run, not a place to go: the card is not a link, and its title is drawn as text' : `href "${this.href}" cannot be read as an address: the card is not a link, and its title is drawn as text`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
if (this.speaks(this.target, 'same') || this.wroteTarget) {
|
|
369
|
+
const opensNew = readTarget(this.target).target === 'new';
|
|
370
|
+
mark(anchor, 'target', opensNew ? '_blank' : null);
|
|
371
|
+
this.wroteTarget = opensNew;
|
|
372
|
+
}
|
|
373
|
+
const wantsBody = this.built || !!(this.headline || this.description || this.siteName || this.siteIcon || this.imageAlt);
|
|
374
|
+
const body = wantsBody ? this.partOf(anchor, 'body', ['body', 'media']) : anchor.querySelector(':scope > [data-part="body"]');
|
|
375
|
+
if (body && anchor.firstElementChild !== body && !anchor.firstElementChild?.classList.contains('ripple'))
|
|
376
|
+
anchor.prepend(body);
|
|
377
|
+
if (body && this.speaks(this.headline)) {
|
|
378
|
+
const title = plainText(this.headline);
|
|
379
|
+
if (title) {
|
|
380
|
+
const made = this.partOf(body, 'title', BODY_ORDER);
|
|
381
|
+
say(made, title);
|
|
382
|
+
mark(made, 'dir', 'auto');
|
|
383
|
+
mark(made, 'data-address', null);
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
// The address stands in its place (enhance), or — in a card that is no link — nothing does.
|
|
387
|
+
const part = body.querySelector(':scope > [data-part="title"]');
|
|
388
|
+
if (part)
|
|
389
|
+
say(part, '');
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
if (body && this.speaks(this.description)) {
|
|
393
|
+
const description = plainText(this.description);
|
|
394
|
+
if (description) {
|
|
395
|
+
const part = this.partOf(body, 'description', BODY_ORDER);
|
|
396
|
+
say(part, description);
|
|
397
|
+
mark(part, 'dir', 'auto');
|
|
398
|
+
}
|
|
399
|
+
else
|
|
400
|
+
this.drop(body, 'description');
|
|
401
|
+
}
|
|
402
|
+
if (this.speaks(this.image))
|
|
403
|
+
this.picture(anchor, 'media', ['body', 'media'], this.image, newImage, 'image', 'LKC-14');
|
|
404
|
+
if (body && this.speaks(this.imageAlt)) {
|
|
405
|
+
const alt = plainText(this.imageAlt);
|
|
406
|
+
if (alt && anchor.querySelector(':scope > img[data-part="media"]'))
|
|
407
|
+
say(this.partOf(body, 'image-alt', BODY_ORDER), alt);
|
|
408
|
+
else
|
|
409
|
+
this.drop(body, 'image-alt');
|
|
410
|
+
}
|
|
411
|
+
if (body && this.speaks(this.siteName)) {
|
|
412
|
+
const name = plainText(this.siteName);
|
|
413
|
+
if (name) {
|
|
414
|
+
const part = this.partOf(this.partOf(body, 'site', BODY_ORDER), 'site-name', SITE_ORDER);
|
|
415
|
+
const text = part.querySelector(':scope > span') ?? part.appendChild(document.createElement('span'));
|
|
416
|
+
say(text, name);
|
|
417
|
+
mark(text, 'dir', 'auto');
|
|
418
|
+
}
|
|
419
|
+
else
|
|
420
|
+
this.drop(body.querySelector(':scope > [data-part="site"]'), 'site-name');
|
|
421
|
+
}
|
|
422
|
+
if (body && this.speaks(this.siteIcon)) {
|
|
423
|
+
const site = pictureAddress(this.siteIcon) && !this.refused.has(pictureAddress(this.siteIcon)) ? this.partOf(body, 'site', BODY_ORDER) : body.querySelector(':scope > [data-part="site"]');
|
|
424
|
+
this.picture(site, 'site-icon', SITE_ORDER, this.siteIcon, newIcon, 'siteIcon', 'LKC-14');
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* LKC-10, LKC-11, LKC-14: a picture the card was given, as an `<img>` and nothing else — asked for without the page's
|
|
429
|
+
* address and only once the card is near what is shown. An address that is no picture's is treated as empty.
|
|
430
|
+
*/
|
|
431
|
+
picture(parent, id, order, given, renew, prop, behavior) {
|
|
432
|
+
const src = pictureAddress(given);
|
|
433
|
+
if (!src && given.trim())
|
|
434
|
+
report(this, behavior, `${prop} "${given.length > 96 ? `${given.slice(0, 96)}…` : given}" is not the address of a picture (a script, or an address that cannot be read): it is treated as empty and nothing is asked for`);
|
|
435
|
+
if (!parent)
|
|
436
|
+
return;
|
|
437
|
+
let picture = parent.querySelector(`:scope > img[data-part="${id}"]`);
|
|
438
|
+
if (!src) {
|
|
439
|
+
picture?.remove();
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (renew)
|
|
443
|
+
this.refused.delete(src);
|
|
444
|
+
// LKC-10, LKC-13: a picture that could not be loaded is not asked for again by the card itself.
|
|
445
|
+
if (this.refused.has(src))
|
|
446
|
+
return;
|
|
447
|
+
if (picture && picture.getAttribute('src') === src && !renew)
|
|
448
|
+
return;
|
|
449
|
+
// LKC-13: a new address is a new picture, so that its box — not the picture before it — is drawn until it loads.
|
|
450
|
+
picture?.remove();
|
|
451
|
+
picture = document.createElement('img');
|
|
452
|
+
picture.setAttribute('data-part', id);
|
|
453
|
+
// Every attribute before the address: the request that the address starts already carries them.
|
|
454
|
+
picture.setAttribute('alt', '');
|
|
455
|
+
picture.setAttribute('loading', 'lazy');
|
|
456
|
+
picture.setAttribute('decoding', 'async');
|
|
457
|
+
picture.setAttribute('referrerpolicy', 'no-referrer');
|
|
458
|
+
picture.setAttribute('src', src);
|
|
459
|
+
const later = order.slice(order.indexOf(id) + 1).map((next) => parent.querySelector(`:scope > [data-part="${next}"]`)).find(Boolean);
|
|
460
|
+
if (later)
|
|
461
|
+
later.before(picture);
|
|
462
|
+
else if (id === 'site-icon')
|
|
463
|
+
parent.prepend(picture);
|
|
464
|
+
else
|
|
465
|
+
parent.append(picture);
|
|
466
|
+
}
|
|
467
|
+
/** What a document cannot hold (LKC-36), written on the product's own anchor and on one this element built alike. */
|
|
468
|
+
enhance(anchor) {
|
|
469
|
+
const id = (element, part) => (element.id ||= `tanrei-link-card-${this.serial}-${part}`);
|
|
470
|
+
// LKC-27: what is not a place to go is not a destination, and a card without one is not a link.
|
|
471
|
+
const given = anchor.getAttribute('href');
|
|
472
|
+
if (given !== null && readDestination(given).href === null) {
|
|
473
|
+
anchor.removeAttribute('href');
|
|
474
|
+
if (given.trim())
|
|
475
|
+
report(this, 'LKC-27', readDestination(given).refusal === 'script' ? 'href names a script to run, not a place to go; it is taken off and the card is not a link' : `href "${given}" cannot be read as an address; it is taken off and the card is not a link`);
|
|
476
|
+
}
|
|
477
|
+
const body = anchor.querySelector(':scope > [data-part="body"]');
|
|
478
|
+
const href = anchor.getAttribute('href');
|
|
479
|
+
if (href === null) {
|
|
480
|
+
// Not a link and not drawn as a card: the title as text. It asks for nothing, so its pictures are taken away.
|
|
481
|
+
for (const picture of anchor.querySelectorAll('img[data-part="media"], img[data-part="site-icon"]'))
|
|
482
|
+
picture.remove();
|
|
483
|
+
for (const attribute of ['aria-labelledby', 'aria-describedby', 'target', 'rel'])
|
|
484
|
+
if (this.given.delete(attribute) || attribute === 'target')
|
|
485
|
+
mark(anchor, attribute, null);
|
|
486
|
+
if (this.wroteExternal !== null)
|
|
487
|
+
mark(anchor, 'data-external', null);
|
|
488
|
+
this.wroteExternal = null;
|
|
489
|
+
if (this.built && body)
|
|
490
|
+
for (const part of [...body.children])
|
|
491
|
+
if (part.getAttribute('data-part') !== 'title')
|
|
492
|
+
part.remove();
|
|
493
|
+
if (document.readyState !== 'loading')
|
|
494
|
+
report(this, 'LKC-27', 'it has no destination, so it is not a link and is not drawn as a card: its title, where it has one, is drawn as text');
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
// LKC-23, LKC-27: where it opens, in HTML's spelling; a new context gets no handle to this page.
|
|
498
|
+
const target = (anchor.getAttribute('target') ?? '').trim().toLowerCase();
|
|
499
|
+
const opensNew = target === '_blank';
|
|
500
|
+
if (opensNew) {
|
|
501
|
+
const rel = linkRel(anchor.getAttribute('rel'), 'new');
|
|
502
|
+
if (rel !== null && rel !== anchor.getAttribute('rel'))
|
|
503
|
+
anchor.setAttribute('rel', rel);
|
|
504
|
+
}
|
|
505
|
+
else if (target !== '' && target !== '_self') {
|
|
506
|
+
report(this, 'LKC-27', `target "${anchor.getAttribute('target')}" is not a value the link card defines ("_blank" for a new context, or none); it is taken off and the card opens where the person is`);
|
|
507
|
+
anchor.removeAttribute('target');
|
|
508
|
+
}
|
|
509
|
+
let text = body;
|
|
510
|
+
if (!text) {
|
|
511
|
+
// An anchor that holds only its own text (`<a href="…">Title</a>`): that text is the title.
|
|
512
|
+
const loose = [...anchor.childNodes].filter((node) => !(node instanceof Element && (node.classList.contains('ripple') || node.getAttribute('data-part') === 'media')));
|
|
513
|
+
text = document.createElement('span');
|
|
514
|
+
text.setAttribute('data-part', 'body');
|
|
515
|
+
anchor.prepend(text);
|
|
516
|
+
if (loose.some((node) => (node.textContent ?? '').trim()))
|
|
517
|
+
this.partOf(text, 'title', BODY_ORDER).append(...loose);
|
|
518
|
+
}
|
|
519
|
+
// LKC-5: without a title the address, as it was given, stands in its place and names the card.
|
|
520
|
+
const title = this.partOf(text, 'title', BODY_ORDER);
|
|
521
|
+
if (title.hasAttribute('data-address') || !(title.textContent ?? '').trim()) {
|
|
522
|
+
say(title, href.trim());
|
|
523
|
+
mark(title, 'dir', 'ltr');
|
|
524
|
+
mark(title, 'data-address', '');
|
|
525
|
+
report(this, 'LKC-5', 'the link card has no title: the address is drawn in its place and names it. Give it the destination’s title');
|
|
526
|
+
}
|
|
527
|
+
// LKC-8, LKC-9: the host, from href and from nothing else.
|
|
528
|
+
const host = displayHost(href);
|
|
529
|
+
let site = text.querySelector(':scope > [data-part="site"]');
|
|
530
|
+
let address = site?.querySelector(':scope > [data-part="address"]') ?? null;
|
|
531
|
+
let hostPart = address?.querySelector(':scope > [data-part="host"]') ?? null;
|
|
532
|
+
const written = hostPart?.textContent ?? '';
|
|
533
|
+
if (hostPart && written !== host && written.trim() && written !== this.ownHost) {
|
|
534
|
+
report(this, 'LKC-8', `the host written in the document, "${written.trim().slice(0, 96)}", is not the host of href, "${host}": it is replaced. The host is computed from href and nothing can set it`);
|
|
535
|
+
}
|
|
536
|
+
// LKC-7: a site name that says only what the host says is not drawn.
|
|
537
|
+
const name = site?.querySelector(':scope > [data-part="site-name"]') ?? null;
|
|
538
|
+
const named = (name?.textContent ?? '').trim();
|
|
539
|
+
if (name && !named)
|
|
540
|
+
name.remove();
|
|
541
|
+
const drawsName = !!named && !repeatsHost(named, host);
|
|
542
|
+
if (name && named)
|
|
543
|
+
mark(name, 'data-undrawn', drawsName ? null : '');
|
|
544
|
+
// LKC-24: external exactly as the Link decides it (LNK-30) — the product's word, or the address.
|
|
545
|
+
const wanted = EXTERNALS.includes(String(this.external)) ? this.external : 'auto';
|
|
546
|
+
const marked = anchor.getAttribute('data-external');
|
|
547
|
+
const products = marked !== null && marked !== this.wroteExternal && marked !== DETECTED;
|
|
548
|
+
if (wanted === 'on' || wanted === 'off') {
|
|
549
|
+
this.wroteExternal = wanted === 'on' ? 'true' : 'false';
|
|
550
|
+
mark(anchor, 'data-external', this.wroteExternal);
|
|
551
|
+
}
|
|
552
|
+
else if (!products) {
|
|
553
|
+
const page = this.ownerDocument.location?.href;
|
|
554
|
+
// `anchor.href` is the address as the browser will follow it, read against the document's base.
|
|
555
|
+
const found = isExternal(anchor.href, { ...(page ? { base: page } : {}), site: linkSettings().site ?? [], download: anchor.hasAttribute('download') });
|
|
556
|
+
this.wroteExternal = found ? DETECTED : null;
|
|
557
|
+
mark(anchor, 'data-external', this.wroteExternal);
|
|
558
|
+
}
|
|
559
|
+
const external = anchor.hasAttribute('data-external') && anchor.getAttribute('data-external') !== 'false';
|
|
560
|
+
const shows = opensNew || external;
|
|
561
|
+
// The site line: the address holds the host and, after it, the mark; a line that would hold nothing is not there.
|
|
562
|
+
if (host || shows) {
|
|
563
|
+
site ??= this.partOf(text, 'site', BODY_ORDER);
|
|
564
|
+
address ??= this.partOf(site, 'address', SITE_ORDER);
|
|
565
|
+
if (host) {
|
|
566
|
+
if (!hostPart) {
|
|
567
|
+
hostPart = document.createElement('bdi');
|
|
568
|
+
hostPart.setAttribute('data-part', 'host');
|
|
569
|
+
address.append(hostPart);
|
|
570
|
+
}
|
|
571
|
+
mark(hostPart, 'dir', 'ltr');
|
|
572
|
+
if (written !== host || !hostPart.firstChild)
|
|
573
|
+
hostPart.replaceChildren(...hostNodes(host).map((node) => {
|
|
574
|
+
if (typeof node === 'string')
|
|
575
|
+
return document.createTextNode(node);
|
|
576
|
+
const label = document.createElement(node.name);
|
|
577
|
+
label.textContent = node.children.join('');
|
|
578
|
+
return label;
|
|
579
|
+
}));
|
|
580
|
+
this.ownHost = host;
|
|
581
|
+
}
|
|
582
|
+
else
|
|
583
|
+
hostPart?.remove();
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
hostPart?.remove();
|
|
587
|
+
address?.remove();
|
|
588
|
+
}
|
|
589
|
+
if (!host)
|
|
590
|
+
hostPart = null;
|
|
591
|
+
if (site && !site.firstElementChild) {
|
|
592
|
+
site.remove();
|
|
593
|
+
site = null;
|
|
594
|
+
}
|
|
595
|
+
// LKC-23, LKC-24, LKC-25: the words of a new context, or of another site — the last thing read.
|
|
596
|
+
let words = text.querySelector(':scope > [data-part="words"]');
|
|
597
|
+
// Words the document holds that this element did not write are the product's, and stand where no property speaks.
|
|
598
|
+
if (words && (words.textContent ?? '') !== this.ownWords)
|
|
599
|
+
this.productWords = (words.textContent ?? '').trim();
|
|
600
|
+
const said = plainText(opensNew ? this.targetLabel || this.productWords || wordFor(this, 'targetLabel') : external ? this.externalLabel || this.productWords || wordFor(this, 'externalLabel') : '');
|
|
601
|
+
if (said) {
|
|
602
|
+
words ??= this.partOf(text, 'words', BODY_ORDER);
|
|
603
|
+
say(words, said);
|
|
604
|
+
this.ownWords = said;
|
|
605
|
+
}
|
|
606
|
+
else if (words) {
|
|
607
|
+
words.remove();
|
|
608
|
+
words = null;
|
|
609
|
+
this.ownWords = null;
|
|
610
|
+
}
|
|
611
|
+
if (opensNew && !said)
|
|
612
|
+
report(this, 'LKC-23', 'it opens a new context and targetLabel is empty, so nothing says so to people who cannot see the mark; give it the words ("opens in a new tab", in the product’s language)');
|
|
613
|
+
if (external && !opensNew && !said) {
|
|
614
|
+
report(this, 'LKC-24', 'it leaves the site and nothing says so to people who cannot see the arrow: give it externalLabel, or set the words once for the page with setExternalLabel() of @tanrei/web/link ("external link", in the product’s language; Tanrei ships no words)');
|
|
615
|
+
}
|
|
616
|
+
// LKC-10, LKC-11, LKC-13, LKC-14: the pictures — decoration, asked for as pictures, without the page's address.
|
|
617
|
+
const media = this.readPicture(anchor.querySelector(':scope > img[data-part="media"]'), 'image', 'LKC-13');
|
|
618
|
+
this.readPicture(site?.querySelector(':scope > img[data-part="site-icon"]') ?? null, 'siteIcon', 'LKC-10');
|
|
619
|
+
// Removing a failed icon may have emptied the site line.
|
|
620
|
+
if (site && !site.firstElementChild) {
|
|
621
|
+
site.remove();
|
|
622
|
+
site = null;
|
|
623
|
+
}
|
|
624
|
+
// LKC-25: what a picture shows is read only for a picture that has arrived.
|
|
625
|
+
const alt = text.querySelector(':scope > [data-part="image-alt"]');
|
|
626
|
+
if (alt && !media)
|
|
627
|
+
alt.remove();
|
|
628
|
+
const shown = !!media && media.complete && media.naturalWidth > 0;
|
|
629
|
+
// LKC-25: the title names the link and nothing is added to it; the rest describes it, in order.
|
|
630
|
+
const description = text.querySelector(':scope > [data-part="description"]');
|
|
631
|
+
const describing = [description && (description.textContent ?? '').trim() ? description : null, alt && media && shown ? alt : null, name?.isConnected && drawsName ? name : null, hostPart, words].filter((part) => !!part);
|
|
632
|
+
this.give(anchor, {
|
|
633
|
+
'aria-labelledby': id(title, 'title'),
|
|
634
|
+
'aria-describedby': describing.length ? describing.map((part) => id(part, part.getAttribute('data-part') ?? 'part')).join(' ') : null,
|
|
635
|
+
});
|
|
636
|
+
// LKC-35: nothing inside a link card is pressed by itself.
|
|
637
|
+
for (const inner of this.querySelectorAll(INTERACTIVE)) {
|
|
638
|
+
if (inner === anchor || inner.hasAttribute('inert'))
|
|
639
|
+
continue;
|
|
640
|
+
report(this, 'LKC-35', `it holds an interactive element (<${inner.localName}>): a link card is one link and nothing inside it is pressed by itself. The element is made inert; a preview with its own controls is a Card that holds a Link and those controls`);
|
|
641
|
+
inner.setAttribute('inert', '');
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
/** Writes `wanted` on the anchor, leaving alone what the product wrote there itself, and takes off only what this element wrote. */
|
|
645
|
+
give(anchor, wanted) {
|
|
646
|
+
for (const [attribute, value] of Object.entries(wanted)) {
|
|
647
|
+
if (value === null) {
|
|
648
|
+
if (this.given.delete(attribute))
|
|
649
|
+
anchor.removeAttribute(attribute);
|
|
650
|
+
}
|
|
651
|
+
else if (this.given.has(attribute) || !anchor.hasAttribute(attribute)) {
|
|
652
|
+
mark(anchor, attribute, value);
|
|
653
|
+
this.given.add(attribute);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* A picture as the document holds it: what the markup left out is written (the build step writes all of it, so the
|
|
659
|
+
* first request already carries it), an address that is no picture's is taken away, another party's is reported, and
|
|
660
|
+
* one that has already failed is taken away. Returns the picture where it is still there.
|
|
661
|
+
*/
|
|
662
|
+
readPicture(picture, prop, failure) {
|
|
663
|
+
if (!picture)
|
|
664
|
+
return null;
|
|
665
|
+
const given = picture.getAttribute('src') ?? '';
|
|
666
|
+
if (!pictureAddress(given)) {
|
|
667
|
+
if (given.trim())
|
|
668
|
+
report(this, 'LKC-14', `${prop} "${given.length > 96 ? `${given.slice(0, 96)}…` : given}" is not the address of a picture (a script, or an address that cannot be read): it is treated as empty and nothing is asked for`);
|
|
669
|
+
picture.remove();
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
if (picture.getAttribute('alt') !== '')
|
|
673
|
+
picture.setAttribute('alt', '');
|
|
674
|
+
if (!picture.hasAttribute('referrerpolicy')) {
|
|
675
|
+
report(this, 'LKC-14', `its ${prop} has no referrerpolicy: a picture is asked for without the page’s address; referrerpolicy="no-referrer" is written for it, but the first request may already have carried the address — write it in the markup (linkCardToNodes() does)`);
|
|
676
|
+
picture.setAttribute('referrerpolicy', 'no-referrer');
|
|
677
|
+
}
|
|
678
|
+
if (!picture.hasAttribute('loading'))
|
|
679
|
+
picture.setAttribute('loading', 'lazy');
|
|
680
|
+
if (!picture.hasAttribute('decoding'))
|
|
681
|
+
picture.setAttribute('decoding', 'async');
|
|
682
|
+
try {
|
|
683
|
+
const src = new URL(given, this.baseURI);
|
|
684
|
+
const page = this.ownerDocument.location;
|
|
685
|
+
if (['http:', 'https:'].includes(src.protocol) && page && src.origin !== page.origin) {
|
|
686
|
+
report(this, 'LKC-14', `its ${prop} is asked of ${src.origin}, not of this site: every reader’s browser then tells that party which page is being read. Give a picture the product serves itself (the build-time helper, @tanrei/web/links/node, keeps one among the site’s own files when the site is built)`);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
catch {
|
|
690
|
+
// An address that cannot be read against this page loads nothing, and fails below.
|
|
691
|
+
}
|
|
692
|
+
// A picture that failed before this script could hear it.
|
|
693
|
+
if (picture.complete && picture.naturalWidth === 0 && picture.currentSrc !== '') {
|
|
694
|
+
this.failed(picture, prop, failure);
|
|
695
|
+
return null;
|
|
696
|
+
}
|
|
697
|
+
return picture;
|
|
698
|
+
}
|
|
699
|
+
/** LKC-10, LKC-13: a picture that cannot be loaded is taken away — no mark, no text, no box — and not asked for again. */
|
|
700
|
+
failed(picture, prop, behavior) {
|
|
701
|
+
const src = picture.getAttribute('src') ?? '';
|
|
702
|
+
this.refused.add(src);
|
|
703
|
+
picture.remove();
|
|
704
|
+
report(this, behavior, `its ${prop} "${src.length > 96 ? `${src.slice(0, 96)}…` : src}" cannot be loaded or decoded: the card is drawn without it`);
|
|
705
|
+
}
|
|
706
|
+
own(event) {
|
|
707
|
+
const anchor = this.anchor();
|
|
708
|
+
return anchor && event.target instanceof Node && anchor.contains(event.target) ? anchor : null;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
if (!customElements.get('tanrei-link-card'))
|
|
712
|
+
customElements.define('tanrei-link-card', TanreiLinkCard);
|
|
713
|
+
//# sourceMappingURL=link-card.js.map
|