@sanity/themer 0.8.1 → 0.10.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/README.md +159 -19
- package/dist/AnimatedColorWheelIcon-CwWOVAsw.js +171 -0
- package/dist/AnimatedColorWheelIcon-CwWOVAsw.js.map +1 -0
- package/dist/{ResizableSidebar-DD787kQr.js → ResizableSidebar-C1nr3Ls2.js} +1023 -547
- package/dist/ResizableSidebar-C1nr3Ls2.js.map +1 -0
- package/dist/bundle.css +106 -318
- package/dist/index.d.ts +66 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/themes-au1BLKmY.js +139 -0
- package/dist/themes-au1BLKmY.js.map +1 -0
- package/dist/tool.d.ts +3 -14
- package/dist/tool.d.ts.map +1 -1
- package/dist/tool.js +853 -820
- package/dist/tool.js.map +1 -1
- package/package.json +11 -3
- package/dist/ResizableSidebar-DD787kQr.js.map +0 -1
- package/dist/ResizableSidebar.css.ts.vanilla-M9EuPu-q.js +0 -422
- package/dist/ResizableSidebar.css.ts.vanilla-M9EuPu-q.js.map +0 -1
- package/dist/options-CU-emn_p.d.ts +0 -69
- package/dist/options-CU-emn_p.d.ts.map +0 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { t as presets } from "./presets-CqBgS3A-.js";
|
|
2
|
+
import { addTransitionType } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The Studio navbar's root, the `Card` that draws its bottom border — its
|
|
5
|
+
* test id is stable and unique to the navbar, unlike its `data-ui` name
|
|
6
|
+
*/
|
|
7
|
+
const NAVBAR_SELECTOR = "[data-testid=\"studio-navbar\"]";
|
|
8
|
+
var layout = "pcwcs0j", layoutTransitionType = "sanity-themer", viewTransitionClasses = {
|
|
9
|
+
navbarButton: { update: {
|
|
10
|
+
pcwcs02: "none",
|
|
11
|
+
pcwcs03: "none",
|
|
12
|
+
pcwcs00: "pcwcs05",
|
|
13
|
+
pcwcs01: "pcwcs05",
|
|
14
|
+
pcwcs04: "pcwcs05",
|
|
15
|
+
default: "none"
|
|
16
|
+
} },
|
|
17
|
+
navbarButtonTooltip: { update: {
|
|
18
|
+
pcwcs02: "none",
|
|
19
|
+
pcwcs03: "none",
|
|
20
|
+
pcwcs00: "auto",
|
|
21
|
+
pcwcs01: "auto",
|
|
22
|
+
default: "none"
|
|
23
|
+
} },
|
|
24
|
+
sidebar: {
|
|
25
|
+
enter: {
|
|
26
|
+
pcwcs00: "pcwcs0e",
|
|
27
|
+
default: "none"
|
|
28
|
+
},
|
|
29
|
+
update: {
|
|
30
|
+
pcwcs02: "none",
|
|
31
|
+
pcwcs03: "none",
|
|
32
|
+
pcwcs04: "auto",
|
|
33
|
+
default: "none"
|
|
34
|
+
},
|
|
35
|
+
exit: {
|
|
36
|
+
pcwcs01: "pcwcs0g",
|
|
37
|
+
default: "none"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
splitscreen: {
|
|
41
|
+
enter: {
|
|
42
|
+
pcwcs02: "pcwcs0h",
|
|
43
|
+
default: "none"
|
|
44
|
+
},
|
|
45
|
+
update: {
|
|
46
|
+
pcwcs04: "auto",
|
|
47
|
+
default: "none"
|
|
48
|
+
},
|
|
49
|
+
exit: {
|
|
50
|
+
pcwcs03: "pcwcs0i",
|
|
51
|
+
default: "none"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
studio: { update: {
|
|
55
|
+
pcwcs00: "pcwcs06",
|
|
56
|
+
pcwcs01: "pcwcs06",
|
|
57
|
+
pcwcs02: "pcwcs0a",
|
|
58
|
+
pcwcs03: "pcwcs0a",
|
|
59
|
+
pcwcs04: "auto",
|
|
60
|
+
default: "none"
|
|
61
|
+
} }
|
|
62
|
+
}, viewTransitionTypes = {
|
|
63
|
+
open: "pcwcs00",
|
|
64
|
+
close: "pcwcs01",
|
|
65
|
+
"split-screen:open": "pcwcs02",
|
|
66
|
+
"split-screen:close": "pcwcs03",
|
|
67
|
+
crossfade: "pcwcs04"
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Adds the default sanity-themer transition type, which allows custom view transition overrides, as well as customization in userland
|
|
71
|
+
*/
|
|
72
|
+
function addThemerTransitionType(type) {
|
|
73
|
+
if (!(type in viewTransitionTypes)) throw Error("Invalid transition type", { cause: { type } });
|
|
74
|
+
addTransitionType(viewTransitionTypes[type]), addTransitionType(layoutTransitionType);
|
|
75
|
+
}
|
|
76
|
+
/** The slug of the theme the Studio config was generated from @internal */
|
|
77
|
+
const CONFIG_SLUG = "config", CONFIG_TITLE = "Studio config", UNTITLED_THEME = "Untitled theme", initialThemerState = {
|
|
78
|
+
active: null,
|
|
79
|
+
custom: [],
|
|
80
|
+
removed: [],
|
|
81
|
+
order: []
|
|
82
|
+
}, presetsWithSource = presets.map((preset) => Object.assign({}, preset, { source: "preset" }));
|
|
83
|
+
/**
|
|
84
|
+
* Resolves the list of themes: the presets, then the user's own themes —
|
|
85
|
+
* rearranged into the order the user dragged them into, with themes that
|
|
86
|
+
* order does not know about kept in that default order after the ones it
|
|
87
|
+
* does. Removed themes are set aside so they can be restored. The configured
|
|
88
|
+
* theme is not in the list — `ThemeList` shows it ahead of it — and it is
|
|
89
|
+
* what applies when no listed theme does: `active` is `undefined` for it, and
|
|
90
|
+
* for an applied slug that no longer resolves.
|
|
91
|
+
*
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
function resolveThemes(state) {
|
|
95
|
+
let all = [...presetsWithSource];
|
|
96
|
+
for (let theme of state.custom) all.push({
|
|
97
|
+
slug: theme.slug,
|
|
98
|
+
title: theme.title,
|
|
99
|
+
options: theme.options,
|
|
100
|
+
source: "custom",
|
|
101
|
+
...theme.palette ? { palette: theme.palette } : {}
|
|
102
|
+
});
|
|
103
|
+
let position = new Map(state.order.map((slug, index) => [slug, index])), rank = (theme) => position.get(theme.slug) ?? state.order.length;
|
|
104
|
+
all.sort((a, b) => rank(a) - rank(b));
|
|
105
|
+
let removedSlugs = new Set(state.removed), themes = all.filter((theme) => !removedSlugs.has(theme.slug));
|
|
106
|
+
return {
|
|
107
|
+
themes,
|
|
108
|
+
removed: all.filter((theme) => removedSlugs.has(theme.slug)),
|
|
109
|
+
active: themes.find((theme) => theme.slug === state.active)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Creates a custom theme with a slug that cannot collide with the presets or
|
|
114
|
+
* the configured theme.
|
|
115
|
+
*
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
function createCustomTheme(title, options, palette) {
|
|
119
|
+
return {
|
|
120
|
+
slug: `custom-${randomId()}`,
|
|
121
|
+
title,
|
|
122
|
+
options,
|
|
123
|
+
...palette ? { palette } : {}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** The title of a duplicated theme @internal */
|
|
127
|
+
function duplicateTitle(title) {
|
|
128
|
+
return `${displayTitle(title)} copy`;
|
|
129
|
+
}
|
|
130
|
+
/** The title to show for a theme, falling back when the user cleared it @internal */
|
|
131
|
+
function displayTitle(title) {
|
|
132
|
+
return title.trim() || "Untitled theme";
|
|
133
|
+
}
|
|
134
|
+
function randomId() {
|
|
135
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`;
|
|
136
|
+
}
|
|
137
|
+
export { displayTitle as a, resolveThemes as c, viewTransitionClasses as d, NAVBAR_SELECTOR as f, createCustomTheme as i, addThemerTransitionType as l, CONFIG_TITLE as n, duplicateTitle as o, UNTITLED_THEME as r, initialThemerState as s, CONFIG_SLUG as t, layout as u };
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=themes-au1BLKmY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes-au1BLKmY.js","names":["\"default\""],"sources":["../src/tool/constants.ts","../src/tool/ViewTransitions.css.ts","../src/tool/addThemerTransitionType.ts","../src/tool/themes.ts"],"sourcesContent":["/**\n * The largest media index (`useMediaIndex` of `@sanity/ui`) that is too small\n * for the sidebar: up to it the Studio is on a phone-sized screen, which the\n * tool has no layout for yet, so the sidebar stays closed\n */\nexport const MIN_MEDIA_INDEX_FOR_SIDEBAR = 2\n/** The largest media index that is too small for the split preview — two Studios side by side take room */\nexport const MIN_MEDIA_INDEX_FOR_SPLIT_SCREEN = 3\n/**\n * The Studio navbar's root, the `Card` that draws its bottom border — its\n * test id is stable and unique to the navbar, unlike its `data-ui` name\n */\nexport const NAVBAR_SELECTOR = '[data-testid=\"studio-navbar\"]'\n","import {\n createViewTransition,\n globalStyle,\n keyframes,\n style,\n type GlobalStyleRule,\n} from '@vanilla-extract/css'\nimport type {ViewTransitionClass} from 'react'\n\nfunction createViewTransitionType(\n rules: Partial<Record<'new' | 'old' | 'group' | 'imagePair', GlobalStyleRule>>,\n debugId?: string,\n) {\n const type = style({}, debugId)\n if (rules.new) {\n globalStyle(`::view-transition-new(.${type})`, rules.new)\n }\n if (rules.old) {\n globalStyle(`::view-transition-old(.${type})`, rules.old)\n }\n if (rules.group) {\n globalStyle(`::view-transition-group(.${type})`, rules.group)\n }\n if (rules.imagePair) {\n globalStyle(`::view-transition-image-pair(.${type})`, rules.imagePair)\n }\n return type\n}\n\n/**\n * The transition type of the layout's motions — what `ThemerLayout` adds to\n * every transition it starts, and React passes on to the view transition.\n * `:active-view-transition-type()` tells the layout's transitions from any\n * other on the page while they run.\n *\n * It's used on all transition types that userland might want to participate in, for example by setting their own:\n * ```tsx\n * <ViewTransition update={{'sanity-themer': 'auto', default: 'none'}}>\n * ```\n */\nexport const layoutTransitionType = 'sanity-themer'\n\n/**\n * Used with addTransitionType, and on `update` props on <ViewTransition> as the object key\n */\nexport const viewTransitionTypes = {\n 'open': createViewTransition('open'),\n 'close': createViewTransition('close'),\n 'split-screen:open': createViewTransition('split-screen-open'),\n 'split-screen:close': createViewTransition('split-screen-close'),\n 'crossfade': createViewTransition('crossfade'),\n}\n\nconst navbarButtonUpdateTransition = createViewTransitionType({\n new: {animation: 'none'},\n old: {display: 'none'},\n})\n\nconst resizeStudioRules = {inlineSize: '100%', blockSize: '100%', objectFit: 'fill'} as const\nconst resizeStudioTransition = createViewTransitionType(\n {old: resizeStudioRules, new: resizeStudioRules},\n 'resizeStudio',\n)\n\n/**\n * The Studio blurs out of its old width and into its new one as the split copy\n * comes and goes. The blur sits on the image pair that holds both snapshots,\n * not on the snapshots themselves: Safari (WebKit, as of Technology Preview\n * 253) paints a filtered snapshot as raw layer contents, losing the\n * `object-fit` stretch of `resizeStudioRules`, so the Studio scaled wrongly\n * while it resized there. One blur peaking at the cross-over, where the two\n * snapshots meet at half opacity, looks the same as the pair of 12px blurs\n * the snapshots carried before — their visible blur peaked at 6px there too\n */\nconst splitScreenFilter = 'blur(6px)'\nconst splitStudioTransition = createViewTransitionType({\n imagePair: {animationName: keyframes({'50%': {filter: splitScreenFilter}})},\n old: {...resizeStudioRules, animationName: keyframes({to: {opacity: 0}})},\n new: {...resizeStudioRules, animationName: keyframes({from: {opacity: 0}})},\n})\n/**\n * The split copy slides in from the side, or out to it — hidden for the first\n * quarter of the way in, and for the last quarter of the way out\n */\nconst splitScreenSlideIn = keyframes({\n 'from': {transform: 'translateX(-100%)', opacity: 0},\n '25%': {opacity: 0},\n})\nconst splitScreenSlideOut = keyframes({\n 'to': {transform: 'translateX(-100%)', opacity: 0},\n '75%': {opacity: 0},\n})\n\nexport const viewTransitionClasses = {\n navbarButton: {\n update: {\n [viewTransitionTypes['split-screen:open']]: 'none',\n [viewTransitionTypes['split-screen:close']]: 'none',\n [viewTransitionTypes.open]: navbarButtonUpdateTransition,\n [viewTransitionTypes.close]: navbarButtonUpdateTransition,\n [viewTransitionTypes.crossfade]: navbarButtonUpdateTransition,\n default: 'none',\n },\n } as const satisfies Record<string, ViewTransitionClass>,\n navbarButtonTooltip: {\n update: {\n [viewTransitionTypes['split-screen:open']]: 'none',\n [viewTransitionTypes['split-screen:close']]: 'none',\n [viewTransitionTypes.open]: 'auto',\n [viewTransitionTypes.close]: 'auto',\n default: 'none',\n },\n } as const satisfies Record<string, ViewTransitionClass>,\n sidebar: {\n enter: {\n [viewTransitionTypes.open]: createViewTransitionType(\n {new: {animationName: keyframes({from: {transform: 'translateX(100%)'}})}},\n 'panelSlideIn',\n ),\n default: 'none',\n },\n update: {\n [viewTransitionTypes['split-screen:open']]: 'none',\n [viewTransitionTypes['split-screen:close']]: 'none',\n [viewTransitionTypes.crossfade]: 'auto',\n default: 'none',\n },\n exit: {\n [viewTransitionTypes.close]: createViewTransitionType(\n {old: {animationName: keyframes({to: {transform: 'translateX(100%)'}})}},\n 'panelSlideOut',\n ),\n default: 'none',\n },\n } as const satisfies Record<string, ViewTransitionClass>,\n splitscreen: {\n enter: {\n [viewTransitionTypes['split-screen:open']]: createViewTransitionType({\n new: {animationName: splitScreenSlideIn},\n }),\n default: 'none',\n },\n update: {\n [viewTransitionTypes.crossfade]: 'auto',\n default: 'none',\n },\n exit: {\n [viewTransitionTypes['split-screen:close']]: createViewTransitionType({\n old: {animationName: splitScreenSlideOut},\n }),\n default: 'none',\n },\n } as const satisfies Record<string, ViewTransitionClass>,\n studio: {\n update: {\n [viewTransitionTypes['open']]: resizeStudioTransition,\n [viewTransitionTypes['close']]: resizeStudioTransition,\n [viewTransitionTypes['split-screen:open']]: splitStudioTransition,\n [viewTransitionTypes['split-screen:close']]: splitStudioTransition,\n [viewTransitionTypes.crossfade]: 'auto',\n default: 'none',\n },\n } as const satisfies Record<string, ViewTransitionClass>,\n}\n\n/**\n * Default animation timings for all Themer view transitions\n */\nglobalStyle(\n `:root:active-view-transition-type(${layoutTransitionType})::view-transition-group(*)`,\n {animationDuration: '320ms', animationTimingFunction: 'cubic-bezier(0.65, 0, 0.35, 1)'},\n)\n\nglobalStyle(\n [\n `:root:active-view-transition-type(${viewTransitionTypes['split-screen:open']})::view-transition-group(*)`,\n `:root:active-view-transition-type(${viewTransitionTypes['split-screen:close']})::view-transition-group(*)`,\n ].join(','),\n {animationDuration: '480ms'},\n)\n\n/** The layout's `Flex` positions the sidebar overlay on small screens */\nexport const layout = style({\n position: 'relative',\n})\n\n/**\n * Disable animations automatically for themer view transitions if the user signals to do so\n */\nglobalStyle(\n `:root:active-view-transition-type(${layoutTransitionType})::view-transition-group(*),:root:active-view-transition-type(${layoutTransitionType})::view-transition-old(*),:root:active-view-transition-type(${layoutTransitionType})::view-transition-new(*)`,\n {\n '@media': {\n '(prefers-reduced-motion: reduce)': {\n animation: 'none !important',\n },\n },\n },\n)\n","import {addTransitionType} from 'react'\n\nimport {layoutTransitionType, viewTransitionTypes} from './ViewTransitions.css'\n\n/**\n * Adds the default sanity-themer transition type, which allows custom view transition overrides, as well as customization in userland\n */\nexport function addThemerTransitionType(type: keyof typeof viewTransitionTypes) {\n if (!(type in viewTransitionTypes)) {\n throw new Error(`Invalid transition type`, {cause: {type}})\n }\n addTransitionType(viewTransitionTypes[type])\n // Used to mark that a themer transition is happening, can be styled with vanilla css, but also by setting class props on <ViewTransition>\n addTransitionType(layoutTransitionType)\n}\n","import type {BuildThemeOptions} from '../theme/options'\nimport {presets} from '../theme/presets'\nimport type {ImagePalette} from './imagePalette'\n\n/**\n * Where a theme in the themer list comes from: the theme the Studio config\n * was generated from, one of the presets defined in code, or one the user\n * added in the tool. Only custom themes are editable — the others are\n * duplicated into a custom theme first.\n */\ntype ThemerThemeSource = 'config' | 'preset' | 'custom'\n\n/** A theme the themer tool lists @internal */\nexport interface ThemerTheme {\n slug: string\n title: string\n options: BuildThemeOptions\n source: ThemerThemeSource\n /** The palette of the image the theme's colors were taken from, for custom themes */\n palette?: ImagePalette\n}\n\n/** A theme the user added in the tool, as persisted @internal */\nexport interface CustomTheme {\n slug: string\n title: string\n options: BuildThemeOptions\n /** The palette of the image the theme's colors were taken from */\n palette?: ImagePalette\n}\n\n/** The persisted themer state @internal */\nexport interface ThemerState {\n /**\n * The slug of the applied theme — `null` applies nothing on top of the\n * Studio's configured theme\n */\n active: string | null\n /** The themes the user added */\n custom: CustomTheme[]\n /** The slugs of the themes the user removed from the list */\n removed: string[]\n /**\n * The slugs of the themes in the order the user arranged them — themes not\n * in it (new presets, themes added since) follow in their default order\n */\n order: string[]\n}\n\n/** The slug of the theme the Studio config was generated from @internal */\nexport const CONFIG_SLUG = 'config'\n\n/** The title of the theme the Studio config was generated from */\nexport const CONFIG_TITLE = 'Studio config'\n\n/** The title new themes start out with @internal */\nexport const UNTITLED_THEME = 'Untitled theme'\n\n/** @internal */\nexport const initialThemerState: ThemerState = {active: null, custom: [], removed: [], order: []}\n\n/** The themes the tool works with, derived from the persisted state @internal */\nexport interface ResolvedThemes {\n /** The themes to pick from, in list order */\n themes: ThemerTheme[]\n /** The removed themes, which can be restored */\n removed: ThemerTheme[]\n /** The applied theme */\n active: ThemerTheme | undefined\n}\n\nconst presetsWithSource = presets.map((preset) =>\n Object.assign({}, preset, {source: 'preset' as const}),\n)\n\n/**\n * Resolves the list of themes: the presets, then the user's own themes —\n * rearranged into the order the user dragged them into, with themes that\n * order does not know about kept in that default order after the ones it\n * does. Removed themes are set aside so they can be restored. The configured\n * theme is not in the list — `ThemeList` shows it ahead of it — and it is\n * what applies when no listed theme does: `active` is `undefined` for it, and\n * for an applied slug that no longer resolves.\n *\n * @internal\n */\nexport function resolveThemes(state: ThemerState): ResolvedThemes {\n const all: ThemerTheme[] = [...presetsWithSource]\n\n for (const theme of state.custom) {\n all.push({\n slug: theme.slug,\n title: theme.title,\n options: theme.options,\n source: 'custom',\n ...(theme.palette ? {palette: theme.palette} : {}),\n })\n }\n\n const position = new Map(state.order.map((slug, index) => [slug, index]))\n const rank = (theme: ThemerTheme) => position.get(theme.slug) ?? state.order.length\n\n // A stable sort: the themes the order does not know about keep their default order\n all.sort((a, b) => rank(a) - rank(b))\n\n const removedSlugs = new Set(state.removed)\n const themes = all.filter((theme) => !removedSlugs.has(theme.slug))\n const removed = all.filter((theme) => removedSlugs.has(theme.slug))\n const active = themes.find((theme) => theme.slug === state.active)\n\n return {themes, removed, active}\n}\n\n/**\n * Creates a custom theme with a slug that cannot collide with the presets or\n * the configured theme.\n *\n * @internal\n */\nexport function createCustomTheme(\n title: string,\n options: BuildThemeOptions,\n palette?: ImagePalette,\n): CustomTheme {\n return {slug: `custom-${randomId()}`, title, options, ...(palette ? {palette} : {})}\n}\n\n/** The title of a duplicated theme @internal */\nexport function duplicateTitle(title: string): string {\n return `${displayTitle(title)} copy`\n}\n\n/** The title to show for a theme, falling back when the user cleared it @internal */\nexport function displayTitle(title: string): string {\n return title.trim() || UNTITLED_THEME\n}\n\nfunction randomId(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID()\n }\n\n return `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`\n}\n"],"mappings":";;;;;;AAYA,MAAa,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEL/B,SAAgB,wBAAwB,MAAwC;CAC9E,IAAI,EAAE,QAAQ,sBACZ,MAAU,MAAM,2BAA2B,EAAC,OAAO,EAAC,KAAI,EAAC,CAAC;CAI5D,AAFA,kBAAkB,oBAAoB,KAAK,GAE3C,kBAAkB,oBAAoB;AACxC;;ACoCA,MAAa,cAAc,UAGd,eAAe,iBAGf,iBAAiB,kBAGjB,qBAAkC;CAAC,QAAQ;CAAM,QAAQ,CAAC;CAAG,SAAS,CAAC;CAAG,OAAO,CAAC;AAAC,GAY1F,oBAAoB,QAAQ,KAAK,WACrC,OAAO,OAAO,CAAC,GAAG,QAAQ,EAAC,QAAQ,SAAiB,CAAC,CACvD;;;;;;;;;;;;AAaA,SAAgB,cAAc,OAAoC;CAChE,IAAM,MAAqB,CAAC,GAAG,iBAAiB;CAEhD,KAAK,IAAM,SAAS,MAAM,QACxB,IAAI,KAAK;EACP,MAAM,MAAM;EACZ,OAAO,MAAM;EACb,SAAS,MAAM;EACf,QAAQ;EACR,GAAI,MAAM,UAAU,EAAC,SAAS,MAAM,QAAO,IAAI,CAAC;CAClD,CAAC;CAGH,IAAM,WAAW,IAAI,IAAI,MAAM,MAAM,KAAK,MAAM,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,GAClE,QAAQ,UAAuB,SAAS,IAAI,MAAM,IAAI,KAAK,MAAM,MAAM;CAG7E,IAAI,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;CAEpC,IAAM,eAAe,IAAI,IAAI,MAAM,OAAO,GACpC,SAAS,IAAI,QAAQ,UAAU,CAAC,aAAa,IAAI,MAAM,IAAI,CAAC;CAIlE,OAAO;EAAC;EAAQ,SAHA,IAAI,QAAQ,UAAU,aAAa,IAAI,MAAM,IAAI,CAGjD;EAAS,QAFV,OAAO,MAAM,UAAU,MAAM,SAAS,MAAM,MAElC;CAAM;AACjC;;;;;;;AAQA,SAAgB,kBACd,OACA,SACA,SACa;CACb,OAAO;EAAC,MAAM,UAAU,SAAS;EAAK;EAAO;EAAS,GAAI,UAAU,EAAC,QAAO,IAAI,CAAC;CAAE;AACrF;;AAGA,SAAgB,eAAe,OAAuB;CACpD,OAAO,GAAG,aAAa,KAAK,EAAE;AAChC;;AAGA,SAAgB,aAAa,OAAuB;CAClD,OAAO,MAAM,KAAK,KAAA;AACpB;AAEA,SAAS,WAAmB;CAK1B,OAJI,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,aACzD,OAAO,WAAW,IAGpB,GAAG,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE;AAC5E"}
|
package/dist/tool.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t as BuildThemeOptions } from "./options-CU-emn_p.js";
|
|
2
1
|
/**
|
|
3
2
|
* Options for the {@link themerTool} plugin.
|
|
4
3
|
*
|
|
@@ -9,20 +8,10 @@ import { t as BuildThemeOptions } from "./options-CU-emn_p.js";
|
|
|
9
8
|
*/
|
|
10
9
|
interface ThemerToolOptions {
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* the `theme` in the Studio config uses:
|
|
15
|
-
*
|
|
16
|
-
* ```ts
|
|
17
|
-
* const config: BuildThemeOptions = {light: {accent: '#1cb485'}, dark: {accent: '#22fca8'}}
|
|
18
|
-
*
|
|
19
|
-
* export default defineConfig({
|
|
20
|
-
* theme: buildTheme(config),
|
|
21
|
-
* plugins: [themerTool({config})],
|
|
22
|
-
* })
|
|
23
|
-
* ```
|
|
11
|
+
* What the tool goes by in the Studio navbar — the toggle's label and
|
|
12
|
+
* tooltip. Defaults to `Themer`.
|
|
24
13
|
*/
|
|
25
|
-
|
|
14
|
+
title?: string;
|
|
26
15
|
}
|
|
27
16
|
/**
|
|
28
17
|
* A Studio plugin that adds a themer sidebar for `buildTheme` themes: a
|
package/dist/tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","names":[],"sources":["../src/tool/plugin.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool.d.ts","names":[],"sources":["../src/tool/plugin.tsx"],"mappings":"AAeA;;;;;;;;UAAiB;;;;;EAKf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BW,6BAAU,cAAA"}
|