@livepeer-frameworks/player-wc 0.1.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/dist/cjs/components/fw-context-menu.js +17 -0
- package/dist/cjs/components/fw-context-menu.js.map +1 -0
- package/dist/cjs/components/fw-dev-mode-panel.js +273 -0
- package/dist/cjs/components/fw-dev-mode-panel.js.map +1 -0
- package/dist/cjs/components/fw-error-overlay.js +101 -0
- package/dist/cjs/components/fw-error-overlay.js.map +1 -0
- package/dist/cjs/components/fw-idle-screen.js +182 -0
- package/dist/cjs/components/fw-idle-screen.js.map +1 -0
- package/dist/cjs/components/fw-loading-spinner.js +62 -0
- package/dist/cjs/components/fw-loading-spinner.js.map +1 -0
- package/dist/cjs/components/fw-player-controls.js +258 -0
- package/dist/cjs/components/fw-player-controls.js.map +1 -0
- package/dist/cjs/components/fw-player.js +570 -0
- package/dist/cjs/components/fw-player.js.map +1 -0
- package/dist/cjs/components/fw-seek-bar.js +233 -0
- package/dist/cjs/components/fw-seek-bar.js.map +1 -0
- package/dist/cjs/components/fw-settings-menu.js +126 -0
- package/dist/cjs/components/fw-settings-menu.js.map +1 -0
- package/dist/cjs/components/fw-skip-indicator.js +143 -0
- package/dist/cjs/components/fw-skip-indicator.js.map +1 -0
- package/dist/cjs/components/fw-speed-indicator.js +61 -0
- package/dist/cjs/components/fw-speed-indicator.js.map +1 -0
- package/dist/cjs/components/fw-stats-panel.js +141 -0
- package/dist/cjs/components/fw-stats-panel.js.map +1 -0
- package/dist/cjs/components/fw-subtitle-renderer.js +70 -0
- package/dist/cjs/components/fw-subtitle-renderer.js.map +1 -0
- package/dist/cjs/components/fw-title-overlay.js +72 -0
- package/dist/cjs/components/fw-title-overlay.js.map +1 -0
- package/dist/cjs/components/fw-toast.js +74 -0
- package/dist/cjs/components/fw-toast.js.map +1 -0
- package/dist/cjs/components/fw-volume-control.js +140 -0
- package/dist/cjs/components/fw-volume-control.js.map +1 -0
- package/dist/cjs/controllers/player-controller-host.js +315 -0
- package/dist/cjs/controllers/player-controller-host.js.map +1 -0
- package/dist/cjs/define.js +45 -0
- package/dist/cjs/define.js.map +1 -0
- package/dist/cjs/icons/index.js +153 -0
- package/dist/cjs/icons/index.js.map +1 -0
- package/dist/cjs/index.js +88 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js +33 -0
- package/dist/cjs/node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/cjs/styles/shared-styles.js +1967 -0
- package/dist/cjs/styles/shared-styles.js.map +1 -0
- package/dist/cjs/styles/utility-styles.js +725 -0
- package/dist/cjs/styles/utility-styles.js.map +1 -0
- package/dist/esm/components/fw-context-menu.js +17 -0
- package/dist/esm/components/fw-context-menu.js.map +1 -0
- package/dist/esm/components/fw-dev-mode-panel.js +273 -0
- package/dist/esm/components/fw-dev-mode-panel.js.map +1 -0
- package/dist/esm/components/fw-error-overlay.js +101 -0
- package/dist/esm/components/fw-error-overlay.js.map +1 -0
- package/dist/esm/components/fw-idle-screen.js +182 -0
- package/dist/esm/components/fw-idle-screen.js.map +1 -0
- package/dist/esm/components/fw-loading-spinner.js +62 -0
- package/dist/esm/components/fw-loading-spinner.js.map +1 -0
- package/dist/esm/components/fw-player-controls.js +258 -0
- package/dist/esm/components/fw-player-controls.js.map +1 -0
- package/dist/esm/components/fw-player.js +570 -0
- package/dist/esm/components/fw-player.js.map +1 -0
- package/dist/esm/components/fw-seek-bar.js +233 -0
- package/dist/esm/components/fw-seek-bar.js.map +1 -0
- package/dist/esm/components/fw-settings-menu.js +126 -0
- package/dist/esm/components/fw-settings-menu.js.map +1 -0
- package/dist/esm/components/fw-skip-indicator.js +143 -0
- package/dist/esm/components/fw-skip-indicator.js.map +1 -0
- package/dist/esm/components/fw-speed-indicator.js +61 -0
- package/dist/esm/components/fw-speed-indicator.js.map +1 -0
- package/dist/esm/components/fw-stats-panel.js +141 -0
- package/dist/esm/components/fw-stats-panel.js.map +1 -0
- package/dist/esm/components/fw-subtitle-renderer.js +70 -0
- package/dist/esm/components/fw-subtitle-renderer.js.map +1 -0
- package/dist/esm/components/fw-title-overlay.js +72 -0
- package/dist/esm/components/fw-title-overlay.js.map +1 -0
- package/dist/esm/components/fw-toast.js +74 -0
- package/dist/esm/components/fw-toast.js.map +1 -0
- package/dist/esm/components/fw-volume-control.js +140 -0
- package/dist/esm/components/fw-volume-control.js.map +1 -0
- package/dist/esm/controllers/player-controller-host.js +313 -0
- package/dist/esm/controllers/player-controller-host.js.map +1 -0
- package/dist/esm/define.js +43 -0
- package/dist/esm/define.js.map +1 -0
- package/dist/esm/icons/index.js +141 -0
- package/dist/esm/icons/index.js.map +1 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js +31 -0
- package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/esm/styles/shared-styles.js +1965 -0
- package/dist/esm/styles/shared-styles.js.map +1 -0
- package/dist/esm/styles/utility-styles.js +723 -0
- package/dist/esm/styles/utility-styles.js.map +1 -0
- package/dist/fw-player.iife.js +4362 -0
- package/dist/fw-player.iife.js.map +1 -0
- package/dist/types/components/fw-context-menu.d.ts +15 -0
- package/dist/types/components/fw-dev-mode-panel.d.ts +24 -0
- package/dist/types/components/fw-error-overlay.d.ts +14 -0
- package/dist/types/components/fw-idle-screen.d.ts +13 -0
- package/dist/types/components/fw-loading-spinner.d.ts +10 -0
- package/dist/types/components/fw-player-controls.d.ts +23 -0
- package/dist/types/components/fw-player.d.ts +74 -0
- package/dist/types/components/fw-seek-bar.d.ts +33 -0
- package/dist/types/components/fw-settings-menu.d.ts +16 -0
- package/dist/types/components/fw-skip-indicator.d.ts +18 -0
- package/dist/types/components/fw-speed-indicator.d.ts +11 -0
- package/dist/types/components/fw-stats-panel.d.ts +18 -0
- package/dist/types/components/fw-subtitle-renderer.d.ts +21 -0
- package/dist/types/components/fw-title-overlay.d.ts +12 -0
- package/dist/types/components/fw-toast.d.ts +12 -0
- package/dist/types/components/fw-volume-control.d.ts +18 -0
- package/dist/types/controllers/player-controller-host.d.ts +119 -0
- package/dist/types/define.d.ts +1 -0
- package/dist/types/icons/index.d.ts +23 -0
- package/dist/types/iife-entry.d.ts +11 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/styles/shared-styles.d.ts +1 -0
- package/dist/types/styles/utility-styles.d.ts +1 -0
- package/package.json +65 -0
- package/src/components/fw-context-menu.ts +23 -0
- package/src/components/fw-dev-mode-panel.ts +285 -0
- package/src/components/fw-error-overlay.ts +96 -0
- package/src/components/fw-idle-screen.ts +182 -0
- package/src/components/fw-loading-spinner.ts +63 -0
- package/src/components/fw-player-controls.ts +256 -0
- package/src/components/fw-player.ts +557 -0
- package/src/components/fw-seek-bar.ts +219 -0
- package/src/components/fw-settings-menu.ts +128 -0
- package/src/components/fw-skip-indicator.ts +139 -0
- package/src/components/fw-speed-indicator.ts +57 -0
- package/src/components/fw-stats-panel.ts +154 -0
- package/src/components/fw-subtitle-renderer.ts +65 -0
- package/src/components/fw-title-overlay.ts +64 -0
- package/src/components/fw-toast.ts +70 -0
- package/src/components/fw-volume-control.ts +140 -0
- package/src/controllers/player-controller-host.ts +457 -0
- package/src/define.ts +43 -0
- package/src/icons/index.ts +209 -0
- package/src/iife-entry.ts +11 -0
- package/src/index.ts +31 -0
- package/src/styles/shared-styles.ts +1962 -0
- package/src/styles/utility-styles.ts +720 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility-styles.js","sources":["../../../../src/styles/utility-styles.ts"],"sourcesContent":["/**\n * Hand-authored Tailwind-equivalent utility classes for Shadow DOM.\n * Only includes utilities actually used by the React player components.\n * ~4KB gzipped — avoids bundling all of Tailwind into shadow DOM.\n */\nimport { css } from \"lit\";\n\nexport const utilityStyles = css`\n /* ======== Layout & Positioning ======== */\n .absolute {\n position: absolute;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: 0;\n }\n .inset-x-0 {\n left: 0;\n right: 0;\n }\n .top-0 {\n top: 0;\n }\n .top-2 {\n top: 0.5rem;\n }\n .top-3 {\n top: 0.75rem;\n }\n .left-0 {\n left: 0;\n }\n .left-3 {\n left: 0.75rem;\n }\n .left-4 {\n left: 1rem;\n }\n .right-0 {\n right: 0;\n }\n .right-2 {\n right: 0.5rem;\n }\n .right-3 {\n right: 0.75rem;\n }\n .right-4 {\n right: 1rem;\n }\n .bottom-0 {\n bottom: 0;\n }\n .bottom-3 {\n bottom: 0.75rem;\n }\n .bottom-4 {\n bottom: 1rem;\n }\n .bottom-20 {\n bottom: 5rem;\n }\n .left-1\\\\/2 {\n left: 50%;\n }\n .top-1\\\\/4 {\n top: 25%;\n }\n\n /* ======== Display & Flex ======== */\n .hidden {\n display: none;\n }\n .flex {\n display: flex;\n }\n .inline-flex {\n display: inline-flex;\n }\n .inline-block {\n display: inline-block;\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-row {\n flex-direction: row;\n }\n .flex-1 {\n flex: 1 1 0%;\n }\n .shrink-0 {\n flex-shrink: 0;\n }\n .items-center {\n align-items: center;\n }\n .items-start {\n align-items: flex-start;\n }\n .items-end {\n align-items: flex-end;\n }\n .justify-center {\n justify-content: center;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-start {\n justify-content: flex-start;\n }\n .justify-end {\n justify-content: flex-end;\n }\n .gap-2 {\n gap: 0.5rem;\n }\n .gap-3 {\n gap: 0.75rem;\n }\n .gap-4 {\n gap: 1rem;\n }\n .gap-6 {\n gap: 1.5rem;\n }\n .gap-8 {\n gap: 2rem;\n }\n\n /* ======== Sizing ======== */\n .w-full {\n width: 100%;\n }\n .w-4 {\n width: 1rem;\n }\n .w-5 {\n width: 1.25rem;\n }\n .w-8 {\n width: 2rem;\n }\n .w-20 {\n width: 5rem;\n }\n .h-full {\n height: 100%;\n }\n .h-1\\\\.5 {\n height: 0.375rem;\n }\n .h-4 {\n height: 1rem;\n }\n .h-5 {\n height: 1.25rem;\n }\n .h-6 {\n height: 1.5rem;\n }\n .h-8 {\n height: 2rem;\n }\n .h-20 {\n height: 5rem;\n }\n .min-w-0 {\n min-width: 0;\n }\n .max-w-sm {\n max-width: 24rem;\n }\n .max-w-\\\\[320px\\\\] {\n max-width: 320px;\n }\n .max-w-\\\\[90\\\\%\\\\] {\n max-width: 90%;\n }\n .max-w-\\\\[80\\\\%\\\\] {\n max-width: 80%;\n }\n .max-w-\\\\[70\\\\%\\\\] {\n max-width: 70%;\n }\n .max-h-\\\\[72px\\\\] {\n max-height: 72px;\n }\n .max-h-\\\\[80\\\\%\\\\] {\n max-height: 80%;\n }\n .min-h-\\\\[280px\\\\] {\n min-height: 280px;\n }\n .min-h-\\\\[300px\\\\] {\n min-height: 300px;\n }\n .w-\\\\[280px\\\\] {\n width: 280px;\n }\n\n /* ======== Spacing ======== */\n .p-1 {\n padding: 0.25rem;\n }\n .p-2 {\n padding: 0.5rem;\n }\n .p-4 {\n padding: 1rem;\n }\n .p-5 {\n padding: 1.25rem;\n }\n .p-6 {\n padding: 1.5rem;\n }\n .px-2\\\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem;\n }\n .px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n }\n .px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n }\n .px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n }\n .py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n }\n .py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n }\n .py-2\\\\.5 {\n padding-top: 0.625rem;\n padding-bottom: 0.625rem;\n }\n .py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n }\n .pl-8 {\n padding-left: 2rem;\n }\n .pr-8 {\n padding-right: 2rem;\n }\n .pb-2 {\n padding-bottom: 0.5rem;\n }\n .pb-3 {\n padding-bottom: 0.75rem;\n }\n .pt-2 {\n padding-top: 0.5rem;\n }\n .mt-0\\\\.5 {\n margin-top: 0.125rem;\n }\n .mt-1 {\n margin-top: 0.25rem;\n }\n .mt-1\\\\.5 {\n margin-top: 0.375rem;\n }\n .mt-2 {\n margin-top: 0.5rem;\n }\n .mt-3 {\n margin-top: 0.75rem;\n }\n .mb-1 {\n margin-bottom: 0.25rem;\n }\n .ml-0\\\\.5 {\n margin-left: 0.125rem;\n }\n .-ml-4 {\n margin-left: -1rem;\n }\n\n /* ======== Typography ======== */\n .text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n }\n .text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n .text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n }\n .text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n }\n .text-center {\n text-align: center;\n }\n .text-right {\n text-align: right;\n }\n .font-mono {\n font-family:\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\",\n monospace;\n }\n .font-medium {\n font-weight: 500;\n }\n .font-semibold {\n font-weight: 600;\n }\n .font-bold {\n font-weight: 700;\n }\n .truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .line-clamp-2 {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n .whitespace-pre-wrap {\n white-space: pre-wrap;\n }\n .tabular-nums {\n font-variant-numeric: tabular-nums;\n }\n .tracking-wider {\n letter-spacing: 0.05em;\n }\n .uppercase {\n text-transform: uppercase;\n }\n\n /* ======== Colors ======== */\n .text-white {\n color: white;\n }\n .text-white\\\\/15 {\n color: rgb(255 255 255 / 0.15);\n }\n .text-white\\\\/50 {\n color: rgb(255 255 255 / 0.5);\n }\n .text-white\\\\/60 {\n color: rgb(255 255 255 / 0.6);\n }\n .text-white\\\\/70 {\n color: rgb(255 255 255 / 0.7);\n }\n .text-white\\\\/80 {\n color: rgb(255 255 255 / 0.8);\n }\n .text-white\\\\/90 {\n color: rgb(255 255 255 / 0.9);\n }\n\n /* ======== Backgrounds ======== */\n .bg-black {\n background-color: black;\n }\n .bg-black\\\\/40 {\n background-color: rgb(0 0 0 / 0.4);\n }\n .bg-black\\\\/70 {\n background-color: rgb(0 0 0 / 0.7);\n }\n .bg-black\\\\/80 {\n background-color: rgb(0 0 0 / 0.8);\n }\n .bg-white {\n background-color: white;\n }\n .bg-white\\\\/10 {\n background-color: rgb(255 255 255 / 0.1);\n }\n .bg-white\\\\/15 {\n background-color: rgb(255 255 255 / 0.15);\n }\n .bg-slate-400 {\n background-color: rgb(148 163 184);\n }\n .bg-slate-900 {\n background-color: rgb(15 23 42);\n }\n .bg-slate-950 {\n background-color: rgb(2 6 23);\n }\n .bg-red-400 {\n background-color: rgb(248 113 113);\n }\n\n /* ======== Gradients ======== */\n .bg-gradient-to-b {\n background-image: linear-gradient(to bottom, var(--tw-gradient-stops));\n }\n .from-black\\\\/70 {\n --tw-gradient-from: rgb(0 0 0 / 0.7);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(0 0 0 / 0));\n }\n .via-black\\\\/40 {\n --tw-gradient-via: rgb(0 0 0 / 0.4);\n --tw-gradient-stops:\n var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to, rgb(0 0 0 / 0));\n }\n .to-transparent {\n --tw-gradient-to: transparent;\n }\n .from-slate-900 {\n --tw-gradient-from: rgb(15 23 42);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(15 23 42 / 0));\n }\n .via-slate-950 {\n --tw-gradient-via: rgb(2 6 23);\n --tw-gradient-stops:\n var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to, rgb(2 6 23 / 0));\n }\n .to-slate-900 {\n --tw-gradient-to: rgb(15 23 42);\n }\n\n /* ======== Borders ======== */\n .border {\n border-width: 1px;\n }\n .border-b {\n border-bottom-width: 1px;\n }\n .border-2 {\n border-width: 2px;\n }\n .border-white\\\\/10 {\n border-color: rgb(255 255 255 / 0.1);\n }\n .border-white\\\\/15 {\n border-color: rgb(255 255 255 / 0.15);\n }\n .rounded {\n border-radius: 0.25rem;\n }\n .rounded-md {\n border-radius: 0.375rem;\n }\n .rounded-lg {\n border-radius: 0.5rem;\n }\n .rounded-xl {\n border-radius: 0.75rem;\n }\n .rounded-full {\n border-radius: 9999px;\n }\n .rounded-\\\\[4px\\\\] {\n border-radius: 4px;\n }\n .outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n\n /* ======== Opacity ======== */\n .opacity-0 {\n opacity: 0;\n }\n .opacity-25 {\n opacity: 0.25;\n }\n .opacity-50 {\n opacity: 0.5;\n }\n .opacity-60 {\n opacity: 0.6;\n }\n .opacity-70 {\n opacity: 0.7;\n }\n .opacity-75 {\n opacity: 0.75;\n }\n .opacity-90 {\n opacity: 0.9;\n }\n .opacity-100 {\n opacity: 1;\n }\n\n /* ======== Effects ======== */\n .shadow-lg {\n box-shadow:\n 0 10px 15px -3px rgb(0 0 0 / 0.1),\n 0 4px 6px -4px rgb(0 0 0 / 0.1);\n }\n .shadow-xl {\n box-shadow:\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1);\n }\n .shadow-inner {\n box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);\n }\n .backdrop-blur {\n backdrop-filter: blur(8px);\n }\n .backdrop-blur-sm {\n backdrop-filter: blur(4px);\n }\n\n /* ======== Overflow ======== */\n .overflow-hidden {\n overflow: hidden;\n }\n .overflow-auto {\n overflow: auto;\n }\n\n /* ======== Interaction ======== */\n .pointer-events-none {\n pointer-events: none;\n }\n .pointer-events-auto {\n pointer-events: auto;\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .cursor-not-allowed {\n cursor: not-allowed;\n }\n\n /* ======== Z-Index ======== */\n .z-5 {\n z-index: 5;\n }\n .z-10 {\n z-index: 10;\n }\n .z-20 {\n z-index: 20;\n }\n .z-30 {\n z-index: 30;\n }\n .z-40 {\n z-index: 40;\n }\n .z-100 {\n z-index: 100;\n }\n\n /* ======== Transforms ======== */\n .transform {\n transform: var(--tw-transform);\n }\n .scale-50 {\n transform: scale(0.5);\n }\n .scale-75 {\n transform: scale(0.75);\n }\n .scale-90 {\n transform: scale(0.9);\n }\n .scale-100 {\n transform: scale(1);\n }\n .scale-110 {\n transform: scale(1.1);\n }\n .scale-120 {\n transform: scale(1.2);\n }\n .-translate-x-1\\\\/2 {\n transform: translateX(-50%);\n }\n .translate-x-1\\\\/2 {\n transform: translateX(50%);\n }\n .rotate-45 {\n transform: rotate(45deg);\n }\n .-rotate-45 {\n transform: rotate(-45deg);\n }\n .rotate-90 {\n transform: rotate(90deg);\n }\n\n /* ======== Transitions ======== */\n .transition {\n transition-property:\n color, background-color, border-color, text-decoration-color, fill, stroke, opacity,\n box-shadow, transform, filter, backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n .transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n .transition-colors {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n .transition-opacity {\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n .transition-transform {\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n .duration-150 {\n transition-duration: 150ms;\n }\n .duration-200 {\n transition-duration: 200ms;\n }\n .duration-300 {\n transition-duration: 300ms;\n }\n .duration-500 {\n transition-duration: 500ms;\n }\n .ease-out {\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n }\n .ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);\n }\n\n /* ======== Animations ======== */\n .animate-spin {\n animation: _fw-spin 1s linear infinite;\n }\n .animate-pulse {\n animation: _fw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n }\n @keyframes _fw-spin {\n to {\n transform: rotate(360deg);\n }\n }\n @keyframes _fw-pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.5;\n }\n }\n\n /* ======== Responsive (sm: 640px+) ======== */\n @media (min-width: 640px) {\n .sm\\\\:flex {\n display: flex;\n }\n .sm\\\\:left-4 {\n left: 1rem;\n }\n .sm\\\\:top-4 {\n top: 1rem;\n }\n .sm\\\\:right-4 {\n right: 1rem;\n }\n .sm\\\\:gap-6 {\n gap: 1.5rem;\n }\n }\n\n /* ======== Hover states ======== */\n .hover\\\\:bg-white\\\\/10:hover {\n background-color: rgb(255 255 255 / 0.1);\n }\n .hover\\\\:text-white:hover {\n color: white;\n }\n .hover\\\\:rotate-90:hover {\n transform: rotate(90deg);\n }\n\n /* ======== Focus-visible states ======== */\n .focus-visible\\\\:ring-2:focus-visible {\n box-shadow: 0 0 0 2px var(--tw-ring-color, rgb(59 130 246));\n }\n .focus-visible\\\\:ring-offset-2:focus-visible {\n box-shadow:\n 0 0 0 2px var(--tw-ring-offset-color, white),\n 0 0 0 4px var(--tw-ring-color, rgb(59 130 246));\n }\n\n /* ======== Group hover ======== */\n .group:hover .group-hover\\\\:rotate-90 {\n transform: rotate(90deg);\n }\n`;\n"],"names":["css"],"mappings":";;;;AAAA;;;;AAIG;AAGI,MAAM,aAAa,GAAGA,OAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __decorate } from '../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { css, LitElement } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
|
|
5
|
+
let FwContextMenu = class FwContextMenu extends LitElement {
|
|
6
|
+
};
|
|
7
|
+
FwContextMenu.styles = css `
|
|
8
|
+
:host {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
FwContextMenu = __decorate([
|
|
13
|
+
customElement("fw-context-menu")
|
|
14
|
+
], FwContextMenu);
|
|
15
|
+
|
|
16
|
+
export { FwContextMenu };
|
|
17
|
+
//# sourceMappingURL=fw-context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fw-context-menu.js","sources":["../../../../src/components/fw-context-menu.ts"],"sourcesContent":["/**\n * <fw-context-menu> — Placeholder for right-click context menu.\n * The actual context menu is rendered inline by <fw-player> since it needs\n * to be positioned relative to mouse coordinates. This component exists\n * for the module export and define.ts registration.\n */\nimport { LitElement, css } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\n\n@customElement(\"fw-context-menu\")\nexport class FwContextMenu extends LitElement {\n static styles = css`\n :host {\n display: none;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"fw-context-menu\": FwContextMenu;\n }\n}\n"],"names":[],"mappings":";;;;AAUO,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU,CAAA;;AACpC,aAAA,CAAA,MAAM,GAAG,GAAG,CAAA;;;;AAIlB,EAAA,CAJY;AADF,aAAa,GAAA,UAAA,CAAA;IADzB,aAAa,CAAC,iBAAiB;AACnB,CAAA,EAAA,aAAa,CAMzB;;;;"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { __decorate } from '../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { css, LitElement, html, nothing } from 'lit';
|
|
3
|
+
import { property, state, customElement } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { sharedStyles } from '../styles/shared-styles.js';
|
|
6
|
+
import { utilityStyles } from '../styles/utility-styles.js';
|
|
7
|
+
import { closeIcon } from '../icons/index.js';
|
|
8
|
+
|
|
9
|
+
let FwDevModePanel = class FwDevModePanel extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.playbackMode = "auto";
|
|
13
|
+
this._activeTab = "config";
|
|
14
|
+
this._modes = ["auto", "low-latency", "quality"];
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
const s = this.pc.s;
|
|
18
|
+
return html `
|
|
19
|
+
<div class="panel fw-dev-panel">
|
|
20
|
+
<div class="header fw-dev-header">
|
|
21
|
+
<div class="tabs">
|
|
22
|
+
<button
|
|
23
|
+
class=${classMap({ tab: true, "tab--active": this._activeTab === "config" })}
|
|
24
|
+
@click=${() => {
|
|
25
|
+
this._activeTab = "config";
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
Config
|
|
29
|
+
</button>
|
|
30
|
+
<button
|
|
31
|
+
class=${classMap({ tab: true, "tab--active": this._activeTab === "stats" })}
|
|
32
|
+
@click=${() => {
|
|
33
|
+
this._activeTab = "stats";
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
Stats
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
<button
|
|
40
|
+
class="close"
|
|
41
|
+
@click=${() => this.dispatchEvent(new CustomEvent("fw-close", { bubbles: true, composed: true }))}
|
|
42
|
+
aria-label="Close panel"
|
|
43
|
+
>
|
|
44
|
+
${closeIcon()}
|
|
45
|
+
</button>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div class="body fw-dev-body">
|
|
49
|
+
${this._activeTab === "config" ? this._renderConfig(s) : this._renderStats(s)}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
_renderConfig(s) {
|
|
55
|
+
return html `
|
|
56
|
+
<div class="section">
|
|
57
|
+
<div class="label">Current Player</div>
|
|
58
|
+
<div class="value">${s.currentPlayerInfo?.name ?? "—"}</div>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="section">
|
|
61
|
+
<div class="label">Current Source</div>
|
|
62
|
+
<div class="value">${s.currentSourceInfo?.type ?? "—"}</div>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="section">
|
|
65
|
+
<div class="label">Playback Mode</div>
|
|
66
|
+
<div class="mode-group fw-dev-mode-group">
|
|
67
|
+
${this._modes.map((mode) => html `
|
|
68
|
+
<button
|
|
69
|
+
class=${classMap({
|
|
70
|
+
"mode-btn": true,
|
|
71
|
+
"fw-dev-mode-btn": true,
|
|
72
|
+
"mode-btn--active": this.playbackMode === mode,
|
|
73
|
+
"fw-dev-mode-btn--active": this.playbackMode === mode,
|
|
74
|
+
})}
|
|
75
|
+
@click=${() => this.pc.setDevModeOptions({ playbackMode: mode })}
|
|
76
|
+
>
|
|
77
|
+
${mode}
|
|
78
|
+
</button>
|
|
79
|
+
`)}
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="actions fw-dev-actions">
|
|
83
|
+
<button
|
|
84
|
+
class="action-btn fw-dev-action-btn"
|
|
85
|
+
@click=${() => {
|
|
86
|
+
this.pc.clearError();
|
|
87
|
+
this.pc.reload();
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
Reload
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
_renderStats(s) {
|
|
96
|
+
const q = s.playbackQuality;
|
|
97
|
+
return html `
|
|
98
|
+
<div class="section">
|
|
99
|
+
<div class="label">Playback</div>
|
|
100
|
+
${this._row("State", s.state)}
|
|
101
|
+
${this._row("Time", `${s.currentTime.toFixed(1)}s / ${isFinite(s.duration) ? s.duration.toFixed(1) + "s" : "∞"}`)}
|
|
102
|
+
${this._row("Volume", `${Math.round(s.volume * 100)}%${s.isMuted ? " (muted)" : ""}`)}
|
|
103
|
+
</div>
|
|
104
|
+
${q
|
|
105
|
+
? html `
|
|
106
|
+
<div class="section">
|
|
107
|
+
<div class="label">Quality</div>
|
|
108
|
+
${this._row("Resolution", this._resolution())}
|
|
109
|
+
${this._row("Bitrate", q.bitrate ? `${Math.round(q.bitrate / 1000)} kbps` : "—")}
|
|
110
|
+
${this._row("Latency", q.latency != null ? `${q.latency.toFixed(2)}s` : "—")}
|
|
111
|
+
${this._row("Buffer", q.bufferedAhead != null ? `${q.bufferedAhead.toFixed(1)}s` : "—")}
|
|
112
|
+
${this._row("Score", q.score != null ? `${q.score.toFixed(0)}` : "—")}
|
|
113
|
+
${this._row("Drops", `${q.frameDropRate?.toFixed(1) ?? "0"}%`)}
|
|
114
|
+
${this._row("Stalls", `${q.stallCount ?? 0}`)}
|
|
115
|
+
</div>
|
|
116
|
+
`
|
|
117
|
+
: nothing}
|
|
118
|
+
`;
|
|
119
|
+
}
|
|
120
|
+
_resolution() {
|
|
121
|
+
const video = this.pc.s.videoElement;
|
|
122
|
+
if (!video || !video.videoWidth || !video.videoHeight)
|
|
123
|
+
return "—";
|
|
124
|
+
return `${video.videoWidth}×${video.videoHeight}`;
|
|
125
|
+
}
|
|
126
|
+
_row(label, value) {
|
|
127
|
+
return html `<div class="stat-row">
|
|
128
|
+
<span class="stat-label">${label}</span><span class="stat-value">${value}</span>
|
|
129
|
+
</div>`;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
FwDevModePanel.styles = [
|
|
133
|
+
sharedStyles,
|
|
134
|
+
utilityStyles,
|
|
135
|
+
css `
|
|
136
|
+
:host {
|
|
137
|
+
display: block;
|
|
138
|
+
}
|
|
139
|
+
.panel {
|
|
140
|
+
width: 320px;
|
|
141
|
+
height: 100%;
|
|
142
|
+
border-left: 1px solid rgb(255 255 255 / 0.1);
|
|
143
|
+
background: rgb(15 23 42);
|
|
144
|
+
overflow: auto;
|
|
145
|
+
font-size: 0.75rem;
|
|
146
|
+
color: rgb(255 255 255 / 0.7);
|
|
147
|
+
}
|
|
148
|
+
.header {
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: space-between;
|
|
152
|
+
padding: 0.5rem 0.75rem;
|
|
153
|
+
border-bottom: 1px solid rgb(255 255 255 / 0.1);
|
|
154
|
+
}
|
|
155
|
+
.tabs {
|
|
156
|
+
display: flex;
|
|
157
|
+
gap: 0.5rem;
|
|
158
|
+
}
|
|
159
|
+
.tab {
|
|
160
|
+
padding: 0.25rem 0.5rem;
|
|
161
|
+
border: none;
|
|
162
|
+
background: none;
|
|
163
|
+
color: rgb(255 255 255 / 0.5);
|
|
164
|
+
font-size: 0.6875rem;
|
|
165
|
+
font-weight: 600;
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
border-radius: 0.25rem;
|
|
168
|
+
}
|
|
169
|
+
.tab--active {
|
|
170
|
+
color: white;
|
|
171
|
+
background: rgb(255 255 255 / 0.1);
|
|
172
|
+
}
|
|
173
|
+
.close {
|
|
174
|
+
display: flex;
|
|
175
|
+
background: none;
|
|
176
|
+
border: none;
|
|
177
|
+
color: rgb(255 255 255 / 0.5);
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
padding: 0;
|
|
180
|
+
}
|
|
181
|
+
.close:hover {
|
|
182
|
+
color: white;
|
|
183
|
+
}
|
|
184
|
+
.body {
|
|
185
|
+
padding: 0.75rem;
|
|
186
|
+
}
|
|
187
|
+
.section {
|
|
188
|
+
margin-bottom: 0.75rem;
|
|
189
|
+
}
|
|
190
|
+
.label {
|
|
191
|
+
font-size: 0.625rem;
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
text-transform: uppercase;
|
|
194
|
+
letter-spacing: 0.05em;
|
|
195
|
+
color: rgb(255 255 255 / 0.4);
|
|
196
|
+
margin-bottom: 0.375rem;
|
|
197
|
+
}
|
|
198
|
+
.value {
|
|
199
|
+
color: rgb(255 255 255 / 0.9);
|
|
200
|
+
font-family: ui-monospace, monospace;
|
|
201
|
+
}
|
|
202
|
+
.mode-group {
|
|
203
|
+
display: flex;
|
|
204
|
+
gap: 0.25rem;
|
|
205
|
+
flex-wrap: wrap;
|
|
206
|
+
}
|
|
207
|
+
.mode-btn {
|
|
208
|
+
padding: 0.25rem 0.5rem;
|
|
209
|
+
border: 1px solid rgb(255 255 255 / 0.15);
|
|
210
|
+
background: none;
|
|
211
|
+
color: rgb(255 255 255 / 0.6);
|
|
212
|
+
font-size: 0.6875rem;
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
border-radius: 0.25rem;
|
|
215
|
+
transition: all 150ms;
|
|
216
|
+
}
|
|
217
|
+
.mode-btn:hover {
|
|
218
|
+
border-color: rgb(255 255 255 / 0.3);
|
|
219
|
+
color: white;
|
|
220
|
+
}
|
|
221
|
+
.mode-btn--active {
|
|
222
|
+
border-color: hsl(var(--tn-blue, 217 89% 61%));
|
|
223
|
+
color: hsl(var(--tn-blue, 217 89% 61%));
|
|
224
|
+
background: hsl(var(--tn-blue, 217 89% 61%) / 0.1);
|
|
225
|
+
}
|
|
226
|
+
.actions {
|
|
227
|
+
display: flex;
|
|
228
|
+
gap: 0.5rem;
|
|
229
|
+
margin-top: 0.5rem;
|
|
230
|
+
}
|
|
231
|
+
.action-btn {
|
|
232
|
+
padding: 0.375rem 0.75rem;
|
|
233
|
+
border: 1px solid rgb(255 255 255 / 0.15);
|
|
234
|
+
background: none;
|
|
235
|
+
color: rgb(255 255 255 / 0.7);
|
|
236
|
+
font-size: 0.6875rem;
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
border-radius: 0.25rem;
|
|
239
|
+
}
|
|
240
|
+
.action-btn:hover {
|
|
241
|
+
border-color: rgb(255 255 255 / 0.3);
|
|
242
|
+
color: white;
|
|
243
|
+
}
|
|
244
|
+
.stat-row {
|
|
245
|
+
display: flex;
|
|
246
|
+
justify-content: space-between;
|
|
247
|
+
padding: 0.125rem 0;
|
|
248
|
+
}
|
|
249
|
+
.stat-label {
|
|
250
|
+
color: rgb(255 255 255 / 0.4);
|
|
251
|
+
}
|
|
252
|
+
.stat-value {
|
|
253
|
+
color: rgb(255 255 255 / 0.8);
|
|
254
|
+
font-family: ui-monospace, monospace;
|
|
255
|
+
font-variant-numeric: tabular-nums;
|
|
256
|
+
}
|
|
257
|
+
`,
|
|
258
|
+
];
|
|
259
|
+
__decorate([
|
|
260
|
+
property({ attribute: false })
|
|
261
|
+
], FwDevModePanel.prototype, "pc", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
property({ type: String })
|
|
264
|
+
], FwDevModePanel.prototype, "playbackMode", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
state()
|
|
267
|
+
], FwDevModePanel.prototype, "_activeTab", void 0);
|
|
268
|
+
FwDevModePanel = __decorate([
|
|
269
|
+
customElement("fw-dev-mode-panel")
|
|
270
|
+
], FwDevModePanel);
|
|
271
|
+
|
|
272
|
+
export { FwDevModePanel };
|
|
273
|
+
//# sourceMappingURL=fw-dev-mode-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fw-dev-mode-panel.js","sources":["../../../../src/components/fw-dev-mode-panel.ts"],"sourcesContent":["/**\n * <fw-dev-mode-panel> — Developer mode panel for forcing player/source selection.\n * Port of DevModePanel.tsx from player-react.\n */\nimport { LitElement, html, css, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { sharedStyles } from \"../styles/shared-styles.js\";\nimport { utilityStyles } from \"../styles/utility-styles.js\";\nimport { closeIcon } from \"../icons/index.js\";\nimport type { PlayerControllerHost } from \"../controllers/player-controller-host.js\";\nimport type { PlaybackMode } from \"@livepeer-frameworks/player-core\";\n\n@customElement(\"fw-dev-mode-panel\")\nexport class FwDevModePanel extends LitElement {\n @property({ attribute: false }) pc!: PlayerControllerHost;\n @property({ type: String }) playbackMode: PlaybackMode = \"auto\";\n\n @state() private _activeTab: \"config\" | \"stats\" = \"config\";\n\n static styles = [\n sharedStyles,\n utilityStyles,\n css`\n :host {\n display: block;\n }\n .panel {\n width: 320px;\n height: 100%;\n border-left: 1px solid rgb(255 255 255 / 0.1);\n background: rgb(15 23 42);\n overflow: auto;\n font-size: 0.75rem;\n color: rgb(255 255 255 / 0.7);\n }\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem 0.75rem;\n border-bottom: 1px solid rgb(255 255 255 / 0.1);\n }\n .tabs {\n display: flex;\n gap: 0.5rem;\n }\n .tab {\n padding: 0.25rem 0.5rem;\n border: none;\n background: none;\n color: rgb(255 255 255 / 0.5);\n font-size: 0.6875rem;\n font-weight: 600;\n cursor: pointer;\n border-radius: 0.25rem;\n }\n .tab--active {\n color: white;\n background: rgb(255 255 255 / 0.1);\n }\n .close {\n display: flex;\n background: none;\n border: none;\n color: rgb(255 255 255 / 0.5);\n cursor: pointer;\n padding: 0;\n }\n .close:hover {\n color: white;\n }\n .body {\n padding: 0.75rem;\n }\n .section {\n margin-bottom: 0.75rem;\n }\n .label {\n font-size: 0.625rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: rgb(255 255 255 / 0.4);\n margin-bottom: 0.375rem;\n }\n .value {\n color: rgb(255 255 255 / 0.9);\n font-family: ui-monospace, monospace;\n }\n .mode-group {\n display: flex;\n gap: 0.25rem;\n flex-wrap: wrap;\n }\n .mode-btn {\n padding: 0.25rem 0.5rem;\n border: 1px solid rgb(255 255 255 / 0.15);\n background: none;\n color: rgb(255 255 255 / 0.6);\n font-size: 0.6875rem;\n cursor: pointer;\n border-radius: 0.25rem;\n transition: all 150ms;\n }\n .mode-btn:hover {\n border-color: rgb(255 255 255 / 0.3);\n color: white;\n }\n .mode-btn--active {\n border-color: hsl(var(--tn-blue, 217 89% 61%));\n color: hsl(var(--tn-blue, 217 89% 61%));\n background: hsl(var(--tn-blue, 217 89% 61%) / 0.1);\n }\n .actions {\n display: flex;\n gap: 0.5rem;\n margin-top: 0.5rem;\n }\n .action-btn {\n padding: 0.375rem 0.75rem;\n border: 1px solid rgb(255 255 255 / 0.15);\n background: none;\n color: rgb(255 255 255 / 0.7);\n font-size: 0.6875rem;\n cursor: pointer;\n border-radius: 0.25rem;\n }\n .action-btn:hover {\n border-color: rgb(255 255 255 / 0.3);\n color: white;\n }\n .stat-row {\n display: flex;\n justify-content: space-between;\n padding: 0.125rem 0;\n }\n .stat-label {\n color: rgb(255 255 255 / 0.4);\n }\n .stat-value {\n color: rgb(255 255 255 / 0.8);\n font-family: ui-monospace, monospace;\n font-variant-numeric: tabular-nums;\n }\n `,\n ];\n\n private _modes: PlaybackMode[] = [\"auto\", \"low-latency\", \"quality\"];\n\n protected render() {\n const s = this.pc.s;\n\n return html`\n <div class=\"panel fw-dev-panel\">\n <div class=\"header fw-dev-header\">\n <div class=\"tabs\">\n <button\n class=${classMap({ tab: true, \"tab--active\": this._activeTab === \"config\" })}\n @click=${() => {\n this._activeTab = \"config\";\n }}\n >\n Config\n </button>\n <button\n class=${classMap({ tab: true, \"tab--active\": this._activeTab === \"stats\" })}\n @click=${() => {\n this._activeTab = \"stats\";\n }}\n >\n Stats\n </button>\n </div>\n <button\n class=\"close\"\n @click=${() =>\n this.dispatchEvent(new CustomEvent(\"fw-close\", { bubbles: true, composed: true }))}\n aria-label=\"Close panel\"\n >\n ${closeIcon()}\n </button>\n </div>\n\n <div class=\"body fw-dev-body\">\n ${this._activeTab === \"config\" ? this._renderConfig(s) : this._renderStats(s)}\n </div>\n </div>\n `;\n }\n\n private _renderConfig(s: typeof this.pc.s) {\n return html`\n <div class=\"section\">\n <div class=\"label\">Current Player</div>\n <div class=\"value\">${s.currentPlayerInfo?.name ?? \"—\"}</div>\n </div>\n <div class=\"section\">\n <div class=\"label\">Current Source</div>\n <div class=\"value\">${s.currentSourceInfo?.type ?? \"—\"}</div>\n </div>\n <div class=\"section\">\n <div class=\"label\">Playback Mode</div>\n <div class=\"mode-group fw-dev-mode-group\">\n ${this._modes.map(\n (mode) => html`\n <button\n class=${classMap({\n \"mode-btn\": true,\n \"fw-dev-mode-btn\": true,\n \"mode-btn--active\": this.playbackMode === mode,\n \"fw-dev-mode-btn--active\": this.playbackMode === mode,\n })}\n @click=${() => this.pc.setDevModeOptions({ playbackMode: mode })}\n >\n ${mode}\n </button>\n `\n )}\n </div>\n </div>\n <div class=\"actions fw-dev-actions\">\n <button\n class=\"action-btn fw-dev-action-btn\"\n @click=${() => {\n this.pc.clearError();\n this.pc.reload();\n }}\n >\n Reload\n </button>\n </div>\n `;\n }\n\n private _renderStats(s: typeof this.pc.s) {\n const q = s.playbackQuality;\n return html`\n <div class=\"section\">\n <div class=\"label\">Playback</div>\n ${this._row(\"State\", s.state)}\n ${this._row(\n \"Time\",\n `${s.currentTime.toFixed(1)}s / ${isFinite(s.duration) ? s.duration.toFixed(1) + \"s\" : \"∞\"}`\n )}\n ${this._row(\"Volume\", `${Math.round(s.volume * 100)}%${s.isMuted ? \" (muted)\" : \"\"}`)}\n </div>\n ${q\n ? html`\n <div class=\"section\">\n <div class=\"label\">Quality</div>\n ${this._row(\"Resolution\", this._resolution())}\n ${this._row(\"Bitrate\", q.bitrate ? `${Math.round(q.bitrate / 1000)} kbps` : \"—\")}\n ${this._row(\"Latency\", q.latency != null ? `${q.latency.toFixed(2)}s` : \"—\")}\n ${this._row(\n \"Buffer\",\n q.bufferedAhead != null ? `${q.bufferedAhead.toFixed(1)}s` : \"—\"\n )}\n ${this._row(\"Score\", q.score != null ? `${q.score.toFixed(0)}` : \"—\")}\n ${this._row(\"Drops\", `${q.frameDropRate?.toFixed(1) ?? \"0\"}%`)}\n ${this._row(\"Stalls\", `${q.stallCount ?? 0}`)}\n </div>\n `\n : nothing}\n `;\n }\n\n private _resolution(): string {\n const video = this.pc.s.videoElement;\n if (!video || !video.videoWidth || !video.videoHeight) return \"—\";\n return `${video.videoWidth}×${video.videoHeight}`;\n }\n\n private _row(label: string, value: string) {\n return html`<div class=\"stat-row\">\n <span class=\"stat-label\">${label}</span><span class=\"stat-value\">${value}</span>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"fw-dev-mode-panel\": FwDevModePanel;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAcO,IAAM,cAAc,GAApB,MAAM,cAAe,S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,UAAU,IAAI,CAAC,KAAK,CAAC,WAAW;AAAE,YAAA,OAAO,GAAG;QACjE,OAAO,CAAA,EAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,WAAW,CAAA,CAAE;IACnD;IAEQ,IAAI,CAAC,KAAa,EAAE,KAAa,EAAA;AACvC,QAAA,OAAO,IAAI,CAAA,CAAA;AACkB,+BAAA,EAAA,KAAK,mCAAmC,KAAK,CAAA;WACnE;IACT;;AAjQO,cAAA,CAAA,MAAM,GAAG;IACd,YAAY;IACZ,aAAa;AACb,IAAA,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0HF,IAAA,CAAA;AACF,CA9HY;AALmB,UAAA,CAAA;AAA/B,IAAA,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;AAA4B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,IAAA,EAAA,MAAA,CAAA;AAC9B,UAAA,CAAA;AAA3B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AAAsC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAE/C,UAAA,CAAA;AAAhB,IAAA,KAAK;AAAqD,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAJhD,cAAc,GAAA,UAAA,CAAA;IAD1B,aAAa,CAAC,mBAAmB;AACrB,CAAA,EAAA,cAAc,CAwQ1B;;;;"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { __decorate } from '../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { css, LitElement, html } from 'lit';
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { sharedStyles } from '../styles/shared-styles.js';
|
|
6
|
+
import { utilityStyles } from '../styles/utility-styles.js';
|
|
7
|
+
import { closeIcon } from '../icons/index.js';
|
|
8
|
+
|
|
9
|
+
let FwErrorOverlay = class FwErrorOverlay extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.error = null;
|
|
13
|
+
this.isPassive = false;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return html `
|
|
17
|
+
<div
|
|
18
|
+
role="alert"
|
|
19
|
+
aria-live="assertive"
|
|
20
|
+
class=${classMap({
|
|
21
|
+
"fw-error-overlay": true,
|
|
22
|
+
"fw-error-overlay--passive": this.isPassive,
|
|
23
|
+
"fw-error-overlay--fullscreen": !this.isPassive,
|
|
24
|
+
})}
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
class=${classMap({
|
|
28
|
+
"fw-error-popup": true,
|
|
29
|
+
"fw-error-popup--passive": this.isPassive,
|
|
30
|
+
"fw-error-popup--fullscreen": !this.isPassive,
|
|
31
|
+
})}
|
|
32
|
+
>
|
|
33
|
+
<div
|
|
34
|
+
class=${classMap({
|
|
35
|
+
"fw-error-header": true,
|
|
36
|
+
"fw-error-header--warning": this.isPassive,
|
|
37
|
+
"fw-error-header--error": !this.isPassive,
|
|
38
|
+
})}
|
|
39
|
+
>
|
|
40
|
+
<span
|
|
41
|
+
class=${classMap({
|
|
42
|
+
"fw-error-title": true,
|
|
43
|
+
"fw-error-title--warning": this.isPassive,
|
|
44
|
+
"fw-error-title--error": !this.isPassive,
|
|
45
|
+
})}
|
|
46
|
+
>${this.isPassive ? "Warning" : "Error"}</span
|
|
47
|
+
>
|
|
48
|
+
<button
|
|
49
|
+
type="button"
|
|
50
|
+
class="fw-error-close"
|
|
51
|
+
@click=${this._clearError}
|
|
52
|
+
aria-label="Dismiss"
|
|
53
|
+
>
|
|
54
|
+
${closeIcon()}
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="fw-error-body">
|
|
58
|
+
<p class="fw-error-message">Playback issue</p>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="fw-error-actions">
|
|
61
|
+
<button
|
|
62
|
+
type="button"
|
|
63
|
+
class="fw-error-btn"
|
|
64
|
+
aria-label="Retry playback"
|
|
65
|
+
@click=${this._retry}
|
|
66
|
+
>
|
|
67
|
+
Retry
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
_clearError() {
|
|
75
|
+
this.dispatchEvent(new CustomEvent("fw-clear-error", { bubbles: true, composed: true }));
|
|
76
|
+
}
|
|
77
|
+
_retry() {
|
|
78
|
+
this.dispatchEvent(new CustomEvent("fw-retry", { bubbles: true, composed: true }));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
FwErrorOverlay.styles = [
|
|
82
|
+
sharedStyles,
|
|
83
|
+
utilityStyles,
|
|
84
|
+
css `
|
|
85
|
+
:host {
|
|
86
|
+
display: contents;
|
|
87
|
+
}
|
|
88
|
+
`,
|
|
89
|
+
];
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: String })
|
|
92
|
+
], FwErrorOverlay.prototype, "error", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: Boolean, attribute: "is-passive" })
|
|
95
|
+
], FwErrorOverlay.prototype, "isPassive", void 0);
|
|
96
|
+
FwErrorOverlay = __decorate([
|
|
97
|
+
customElement("fw-error-overlay")
|
|
98
|
+
], FwErrorOverlay);
|
|
99
|
+
|
|
100
|
+
export { FwErrorOverlay };
|
|
101
|
+
//# sourceMappingURL=fw-error-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fw-error-overlay.js","sources":["../../../../src/components/fw-error-overlay.ts"],"sourcesContent":["import { LitElement, html, css } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { sharedStyles } from \"../styles/shared-styles.js\";\nimport { utilityStyles } from \"../styles/utility-styles.js\";\nimport { closeIcon } from \"../icons/index.js\";\n\n@customElement(\"fw-error-overlay\")\nexport class FwErrorOverlay extends LitElement {\n @property({ type: String }) error: string | null = null;\n @property({ type: Boolean, attribute: \"is-passive\" }) isPassive = false;\n\n static styles = [\n sharedStyles,\n utilityStyles,\n css`\n :host {\n display: contents;\n }\n `,\n ];\n\n protected render() {\n return html`\n <div\n role=\"alert\"\n aria-live=\"assertive\"\n class=${classMap({\n \"fw-error-overlay\": true,\n \"fw-error-overlay--passive\": this.isPassive,\n \"fw-error-overlay--fullscreen\": !this.isPassive,\n })}\n >\n <div\n class=${classMap({\n \"fw-error-popup\": true,\n \"fw-error-popup--passive\": this.isPassive,\n \"fw-error-popup--fullscreen\": !this.isPassive,\n })}\n >\n <div\n class=${classMap({\n \"fw-error-header\": true,\n \"fw-error-header--warning\": this.isPassive,\n \"fw-error-header--error\": !this.isPassive,\n })}\n >\n <span\n class=${classMap({\n \"fw-error-title\": true,\n \"fw-error-title--warning\": this.isPassive,\n \"fw-error-title--error\": !this.isPassive,\n })}\n >${this.isPassive ? \"Warning\" : \"Error\"}</span\n >\n <button\n type=\"button\"\n class=\"fw-error-close\"\n @click=${this._clearError}\n aria-label=\"Dismiss\"\n >\n ${closeIcon()}\n </button>\n </div>\n <div class=\"fw-error-body\">\n <p class=\"fw-error-message\">Playback issue</p>\n </div>\n <div class=\"fw-error-actions\">\n <button\n type=\"button\"\n class=\"fw-error-btn\"\n aria-label=\"Retry playback\"\n @click=${this._retry}\n >\n Retry\n </button>\n </div>\n </div>\n </div>\n `;\n }\n\n private _clearError() {\n this.dispatchEvent(new CustomEvent(\"fw-clear-error\", { bubbles: true, composed: true }));\n }\n\n private _retry() {\n this.dispatchEvent(new CustomEvent(\"fw-retry\", { bubb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A,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1F;IAEQ,MAAM,GAAA;AACZ,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACpF;;AA5EO,cAAA,CAAA,MAAM,GAAG;IACd,YAAY;IACZ,aAAa;AACb,IAAA,GAAG,CAAA;;;;AAIF,IAAA,CAAA;AACF,CARY;AAHe,UAAA,CAAA;AAA3B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AAA8B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AACF,UAAA,CAAA;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE;AAAoB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAF7D,cAAc,GAAA,UAAA,CAAA;IAD1B,aAAa,CAAC,kBAAkB;AACpB,CAAA,EAAA,cAAc,CAiF1B;;;;"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { __decorate } from '../node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { css, LitElement, nothing, html } from 'lit';
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
|
+
import { sharedStyles } from '../styles/shared-styles.js';
|
|
5
|
+
import { utilityStyles } from '../styles/utility-styles.js';
|
|
6
|
+
|
|
7
|
+
let FwIdleScreen = class FwIdleScreen extends LitElement {
|
|
8
|
+
render() {
|
|
9
|
+
const isOffline = this.status === "OFFLINE";
|
|
10
|
+
const isInitializing = this.status === "INITIALIZING" || this.status === "STARTING";
|
|
11
|
+
return html `
|
|
12
|
+
<div class="idle">
|
|
13
|
+
<div class="particles">
|
|
14
|
+
${[0, 1, 2, 3, 4, 5, 6, 7].map((i) => html `
|
|
15
|
+
<div
|
|
16
|
+
class="particle"
|
|
17
|
+
style="left: ${10 + i * 11}%; top: ${20 + (i % 3) * 25}%; --dur: ${6 +
|
|
18
|
+
i * 0.8}s; background: hsl(${217 + i * 15} 70% 60%); animation-delay: ${i * -1}s;"
|
|
19
|
+
></div>
|
|
20
|
+
`)}
|
|
21
|
+
</div>
|
|
22
|
+
<div class="card">
|
|
23
|
+
<div class="status-icon">
|
|
24
|
+
${isOffline ? html `<div class="offline-dot"></div>` : html `<div class="spinner"></div>`}
|
|
25
|
+
</div>
|
|
26
|
+
${this.status ? html `<div class="label">${this.status}</div>` : nothing}
|
|
27
|
+
${this.message ? html `<div class="msg">${this.message}</div>` : nothing}
|
|
28
|
+
${isInitializing && this.percentage != null
|
|
29
|
+
? html `
|
|
30
|
+
<div class="progress-wrap">
|
|
31
|
+
<div
|
|
32
|
+
class="progress-bar"
|
|
33
|
+
style="width: ${Math.min(100, Math.max(0, this.percentage))}%"
|
|
34
|
+
></div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="pct">${Math.round(this.percentage)}%</div>
|
|
37
|
+
`
|
|
38
|
+
: nothing}
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
FwIdleScreen.styles = [
|
|
45
|
+
sharedStyles,
|
|
46
|
+
utilityStyles,
|
|
47
|
+
css `
|
|
48
|
+
:host {
|
|
49
|
+
display: contents;
|
|
50
|
+
}
|
|
51
|
+
.idle {
|
|
52
|
+
position: absolute;
|
|
53
|
+
inset: 0;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
z-index: 15;
|
|
58
|
+
background: linear-gradient(135deg, rgb(15 23 42), rgb(2 6 23), rgb(15 23 42));
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
.card {
|
|
62
|
+
position: relative;
|
|
63
|
+
z-index: 10;
|
|
64
|
+
max-width: 280px;
|
|
65
|
+
width: 100%;
|
|
66
|
+
text-align: center;
|
|
67
|
+
}
|
|
68
|
+
.status-icon {
|
|
69
|
+
margin: 0 auto 0.75rem;
|
|
70
|
+
width: 2.5rem;
|
|
71
|
+
height: 2.5rem;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
}
|
|
76
|
+
.spinner {
|
|
77
|
+
width: 1.5rem;
|
|
78
|
+
height: 1.5rem;
|
|
79
|
+
border: 2px solid rgb(255 255 255 / 0.2);
|
|
80
|
+
border-top-color: hsl(var(--tn-blue, 217 89% 61%));
|
|
81
|
+
border-radius: 50%;
|
|
82
|
+
animation: _fw-spin 1s linear infinite;
|
|
83
|
+
}
|
|
84
|
+
@keyframes _fw-spin {
|
|
85
|
+
to {
|
|
86
|
+
transform: rotate(360deg);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
.offline-dot {
|
|
90
|
+
width: 0.75rem;
|
|
91
|
+
height: 0.75rem;
|
|
92
|
+
border-radius: 50%;
|
|
93
|
+
background: hsl(var(--tn-red, 348 74% 64%));
|
|
94
|
+
animation: _fw-blink 2s ease-in-out infinite;
|
|
95
|
+
}
|
|
96
|
+
@keyframes _fw-blink {
|
|
97
|
+
0%,
|
|
98
|
+
100% {
|
|
99
|
+
opacity: 1;
|
|
100
|
+
}
|
|
101
|
+
50% {
|
|
102
|
+
opacity: 0.3;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.label {
|
|
106
|
+
font-size: 0.6875rem;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
text-transform: uppercase;
|
|
109
|
+
letter-spacing: 0.05em;
|
|
110
|
+
color: rgb(255 255 255 / 0.5);
|
|
111
|
+
margin-bottom: 0.5rem;
|
|
112
|
+
}
|
|
113
|
+
.msg {
|
|
114
|
+
font-size: 0.8125rem;
|
|
115
|
+
color: rgb(255 255 255 / 0.7);
|
|
116
|
+
margin-bottom: 0.75rem;
|
|
117
|
+
}
|
|
118
|
+
.progress-wrap {
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 0.25rem;
|
|
121
|
+
background: rgb(255 255 255 / 0.1);
|
|
122
|
+
border-radius: 2px;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
margin-bottom: 0.5rem;
|
|
125
|
+
}
|
|
126
|
+
.progress-bar {
|
|
127
|
+
height: 100%;
|
|
128
|
+
background: hsl(var(--tn-blue, 217 89% 61%));
|
|
129
|
+
border-radius: 2px;
|
|
130
|
+
transition: width 300ms ease;
|
|
131
|
+
}
|
|
132
|
+
.pct {
|
|
133
|
+
font-size: 0.6875rem;
|
|
134
|
+
color: rgb(255 255 255 / 0.4);
|
|
135
|
+
font-variant-numeric: tabular-nums;
|
|
136
|
+
}
|
|
137
|
+
.particles {
|
|
138
|
+
position: absolute;
|
|
139
|
+
inset: 0;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
}
|
|
143
|
+
.particle {
|
|
144
|
+
position: absolute;
|
|
145
|
+
width: 4px;
|
|
146
|
+
height: 4px;
|
|
147
|
+
border-radius: 50%;
|
|
148
|
+
opacity: 0.3;
|
|
149
|
+
animation: _fw-float var(--dur, 8s) ease-in-out infinite;
|
|
150
|
+
}
|
|
151
|
+
@keyframes _fw-float {
|
|
152
|
+
0%,
|
|
153
|
+
100% {
|
|
154
|
+
transform: translateY(0) translateX(0);
|
|
155
|
+
}
|
|
156
|
+
25% {
|
|
157
|
+
transform: translateY(-20px) translateX(10px);
|
|
158
|
+
}
|
|
159
|
+
50% {
|
|
160
|
+
transform: translateY(-10px) translateX(-5px);
|
|
161
|
+
}
|
|
162
|
+
75% {
|
|
163
|
+
transform: translateY(-30px) translateX(15px);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
`,
|
|
167
|
+
];
|
|
168
|
+
__decorate([
|
|
169
|
+
property({ type: String })
|
|
170
|
+
], FwIdleScreen.prototype, "status", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
property({ type: String })
|
|
173
|
+
], FwIdleScreen.prototype, "message", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
property({ type: Number })
|
|
176
|
+
], FwIdleScreen.prototype, "percentage", void 0);
|
|
177
|
+
FwIdleScreen = __decorate([
|
|
178
|
+
customElement("fw-idle-screen")
|
|
179
|
+
], FwIdleScreen);
|
|
180
|
+
|
|
181
|
+
export { FwIdleScreen };
|
|
182
|
+
//# sourceMappingURL=fw-idle-screen.js.map
|