@motion-proto/live-tokens 0.85.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/editor/component-editor/SlidePagerEditor.svelte +118 -0
- package/src/editor/component-editor/VideoFrameEditor.svelte +73 -0
- package/src/editor/component-editor/VideoLightboxEditor.svelte +108 -0
- package/src/editor/component-editor/registry.ts +40 -1
- package/src/editor/core/sketch/sketchLayer.ts +7 -0
- package/src/editor/overlay/LiveEditorOverlay.svelte +45 -52
- package/src/editor/pages/ComponentEditorPage.svelte +1 -1
- package/src/editor/ui/ThemePanel.svelte +9 -53
- package/src/live-tokens/data/themes/autumn.json +97 -0
- package/src/live-tokens/data/themes/halloween.json +97 -0
- package/src/live-tokens/data/themes/midnight-study.json +97 -0
- package/src/live-tokens/data/themes/ocean.json +97 -0
- package/src/live-tokens/data/themes/royal-velvet.json +97 -0
- package/src/live-tokens/data/themes/sketchy.json +97 -0
- package/src/live-tokens/data/themes/spring-meadow.json +97 -0
- package/src/live-tokens/data/themes/sunset.json +97 -0
- package/src/system/assets/slide-04.webp +0 -0
- package/src/system/assets/slide-05.webp +0 -0
- package/src/system/assets/slide-06.webp +0 -0
- package/src/system/assets/watch-navigation-poster.webp +0 -0
- package/src/system/assets/watch-navigation.mp4 +0 -0
- package/src/system/components/ImageLightbox.svelte +20 -21
- package/src/system/components/SlidePager.svelte +516 -0
- package/src/system/components/VideoFrame.svelte +284 -0
- package/src/system/components/VideoLightbox.svelte +454 -0
- package/src/testing-js/{chunk-RDHCBQ6I.js → chunk-FTLASW2R.js} +366 -2
- package/src/testing-js/chunk-FTLASW2R.js.map +1 -0
- package/src/testing-js/{chunk-XV5CYADO.js → chunk-NXRFTTVL.js} +10 -6
- package/src/testing-js/chunk-NXRFTTVL.js.map +1 -0
- package/src/testing-js/component-behavior.contract.js +1 -1
- package/src/testing-js/component-editor.contract.js +1 -1
- package/src/testing-js/component-render.contract.js +1 -1
- package/src/testing-js/index.d.ts +2 -2
- package/src/testing-js/index.js +2 -2
- package/src/testing-js/page-compliance.contract.js +1 -1
- package/src/testing-js/{vitest-BMLIbDs2.d.ts → vitest-5vWtqwWe.d.ts} +2 -2
- package/src/testing-js/vitest.d.ts +1 -1
- package/src/testing-js/vitest.js +2 -2
- package/src/testing-js/chunk-RDHCBQ6I.js.map +0 -1
- package/src/testing-js/chunk-XV5CYADO.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../testing/vitest.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { mergeConfig, type UserConfig } from 'vite';\nimport type { TestUserConfig } from 'vitest/config';\nimport { CONTRACTS_MODULE_ENV } from './contracts';\n\n// The barrel (`./index`) re-exports this from `./playwright`, which imports\n// `@playwright/test` at module top. A Vitest-only consumer authoring\n// `live-tokens.testing.ts` needs `defineTestingConfig` without that import\n// ever resolving, so it is reachable from here too.\nexport { defineTestingConfig, resolveTestingConfig } from './config';\nexport type { LiveTokensTestingConfig, ResolvedTestingConfig } from './config';\n\nexport interface VitestConfigOptions {\n /** Files the run collects, relative to the project root. Default: the\n * registry and behavior contracts in this module's own directory. */\n include?: string[];\n exclude?: string[];\n setupFiles?: string[];\n /** Default `happy-dom`, which the registry contract needs to mount a store. */\n environment?: TestUserConfig['environment'];\n /** Module the registry contract imports to register the project's\n * components. Reaches the run as an environment variable because the\n * contract file resolves the path itself. */\n registrySetup?: string;\n /** Module `selectedContracts()` imports a project's own `ComponentContract[]`\n * from, same env-var seam as `registrySetup` and mirroring\n * `createPlaywrightConfig`'s own use of it: the behavior contract's\n * `describe.each` runs at module top, before a test can resolve anything\n * for it. */\n contractsModule?: string;\n}\n\nconst CONTRACT_INCLUDE = ['registry.contract.{ts,js}', 'component-behavior.contract.{ts,js}'];\n\n// A root-wide glob also collects the stale package copy inside any nested\n// project's node_modules, which then fails against this project's registry.\nconst CONTRACT_DIR = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * The project's Vite config plus what the registry contract needs on top.\n *\n * The package ships Svelte and TypeScript source and imports a FontAwesome\n * stylesheet. Left external, Node meets that `.css` and stops with\n * `Unknown file extension \".css\"` before a single test runs, so both are\n * inlined for Vite to transform.\n */\nexport function createVitestConfig(\n viteConfig: UserConfig,\n options: VitestConfigOptions = {},\n): UserConfig {\n return mergeConfig(viteConfig, {\n // `svelte`'s package exports resolve to `index-server.js` without it, whose\n // `mount` throws `lifecycle_function_unavailable`, and whose\n // `createEventDispatcher` is a silent no-op. A project's own vite config\n // states the condition for its build, not for a test run under happy-dom.\n resolve: { conditions: ['browser'] },\n test: {\n ...(options.include ? { include: options.include } : { dir: CONTRACT_DIR, include: CONTRACT_INCLUDE }),\n // Vitest's own default drops everything under `node_modules`, which is\n // where an installed package's contract file lives.\n exclude: options.exclude ?? [],\n ...(options.setupFiles ? { setupFiles: options.setupFiles } : {}),\n environment: options.environment ?? 'happy-dom',\n environmentOptions: {\n happyDOM: {\n settings: {\n // fontLoader injects <link rel=stylesheet> for the theme's font\n // sources, which happy-dom would fetch from Google and Typekit for\n // real. That puts the public internet on the release gate's\n // critical path; treat the load as satisfied instead.\n disableCSSFileLoading: true,\n handleDisabledFileLoadingAsSuccess: true,\n },\n },\n },\n server: { deps: { inline: [/@motion-proto\\/live-tokens/, /@fortawesome/] } },\n // Vitest's default preview truncates a failed array-equality assertion\n // to `[ Array(1) ]`, which drops `checkRegistryEntry`'s actual violation\n // text. `check-component --tests` reads that text out of the JSON\n // reporter's `failureMessages` to attribute a finding, so nothing here\n // can afford to be summarized away.\n chaiConfig: { truncateThreshold: 0 },\n ...(options.registrySetup || options.contractsModule\n ? {\n env: {\n ...(options.registrySetup ? { LIVE_TOKENS_REGISTRY_SETUP: options.registrySetup } : {}),\n ...(options.contractsModule ? { [CONTRACTS_MODULE_ENV]: options.contractsModule } : {}),\n },\n }\n : {}),\n },\n } satisf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1
1
|
import { PlaywrightTestProject, PlaywrightTestConfig } from '@playwright/test';
|
|
2
|
-
import { L as LiveTokensTestingConfig } from './vitest-
|
|
3
|
-
export { C as COMPONENTS_PATH_ENV, a as COMPONENT_ENV, D as DEFAULT_PAGE_VIEWPORTS, P as PAGES_ENV, b as PAGE_VIEWPORTS_ENV, c as PageViewport, R as ResolvedTestingConfig, T as TESTING_CONFIG_FILE, V as VitestConfigOptions, d as createVitestConfig, e as defineTestingConfig, f as devServerCommand, r as resolveTestingConfig } from './vitest-
|
|
2
|
+
import { L as LiveTokensTestingConfig } from './vitest-5vWtqwWe.js';
|
|
3
|
+
export { C as COMPONENTS_PATH_ENV, a as COMPONENT_ENV, D as DEFAULT_PAGE_VIEWPORTS, P as PAGES_ENV, b as PAGE_VIEWPORTS_ENV, c as PageViewport, R as ResolvedTestingConfig, T as TESTING_CONFIG_FILE, V as VitestConfigOptions, d as createVitestConfig, e as defineTestingConfig, f as devServerCommand, r as resolveTestingConfig } from './vitest-5vWtqwWe.js';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import 'vitest/config';
|
|
6
6
|
|
package/src/testing-js/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-3UKGXCDL.js";
|
|
7
7
|
import {
|
|
8
8
|
createVitestConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NXRFTTVL.js";
|
|
10
10
|
import {
|
|
11
11
|
COMPONENTS_PATH_ENV,
|
|
12
12
|
COMPONENT_ENV,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
allContracts,
|
|
24
24
|
selectedContracts,
|
|
25
25
|
shippedContracts
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FTLASW2R.js";
|
|
27
27
|
|
|
28
28
|
// src/testing/playwright.ts
|
|
29
29
|
import path2 from "path";
|
|
@@ -68,8 +68,8 @@ declare function resolveTestingConfig(config?: LiveTokensTestingConfig, root?: s
|
|
|
68
68
|
declare function devServerCommand(command: string, host: string, port: number): string;
|
|
69
69
|
|
|
70
70
|
interface VitestConfigOptions {
|
|
71
|
-
/** Files the run collects
|
|
72
|
-
*
|
|
71
|
+
/** Files the run collects, relative to the project root. Default: the
|
|
72
|
+
* registry and behavior contracts in this module's own directory. */
|
|
73
73
|
include?: string[];
|
|
74
74
|
exclude?: string[];
|
|
75
75
|
setupFiles?: string[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vite';
|
|
2
2
|
import 'vitest/config';
|
|
3
|
-
export { L as LiveTokensTestingConfig, R as ResolvedTestingConfig, V as VitestConfigOptions, d as createVitestConfig, e as defineTestingConfig, r as resolveTestingConfig } from './vitest-
|
|
3
|
+
export { L as LiveTokensTestingConfig, R as ResolvedTestingConfig, V as VitestConfigOptions, d as createVitestConfig, e as defineTestingConfig, r as resolveTestingConfig } from './vitest-5vWtqwWe.js';
|
package/src/testing-js/vitest.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVitestConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NXRFTTVL.js";
|
|
4
4
|
import {
|
|
5
5
|
defineTestingConfig,
|
|
6
6
|
resolveTestingConfig
|
|
7
7
|
} from "./chunk-NB3NZRBM.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-FTLASW2R.js";
|
|
9
9
|
export {
|
|
10
10
|
createVitestConfig,
|
|
11
11
|
defineTestingConfig,
|