rockin 0.0.43 → 0.0.44
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/{chunk-GL2CQ5TR.js → chunk-23GWTX3S.js} +15 -4
- package/dist/{chunk-4ILCWFOE.js → chunk-53MRWZE4.js} +1 -1
- package/dist/{chunk-YA5PSI7E.js → chunk-VFN3HOYP.js} +15 -3
- package/dist/hooks/index.js +3 -3
- package/dist/index.d.ts +41 -4
- package/dist/index.js +6 -4
- package/dist/layout.js +1 -1
- package/dist/lib/index.d.ts +3 -120
- package/dist/lib/index.js +3 -1
- package/dist/preferences-CvWGOnty.d.ts +158 -0
- package/dist/provider.js +2 -2
- package/dist/ui/bridge.js +1 -1
- package/dist/ui/code-block.js +2 -2
- package/dist/ui/drawer-dialog.js +3 -3
- package/dist/ui/farmer/div.js +3 -3
- package/dist/ui/sonner.js +2 -2
- package/dist/ui/theme-switcher.js +2 -2
- package/dist/ui/theme-toggle.js +2 -2
- package/package.json +1 -1
|
@@ -7,10 +7,12 @@ import {
|
|
|
7
7
|
var ACCENTS = ["slate", "violet", "mint", "gold"];
|
|
8
8
|
var DEVICES = ["mobile", "desktop"];
|
|
9
9
|
var MOBILE_QUERY = "(max-width: 767px)";
|
|
10
|
+
var VIEWS = ["grid", "list"];
|
|
10
11
|
var PREFERENCE_COOKIES = {
|
|
11
12
|
colorScheme: "color-scheme",
|
|
12
13
|
accent: "accent",
|
|
13
|
-
device: "device"
|
|
14
|
+
device: "device",
|
|
15
|
+
view: "view"
|
|
14
16
|
};
|
|
15
17
|
function createAppPreferences(cookie) {
|
|
16
18
|
const device = createPreference({
|
|
@@ -33,7 +35,14 @@ function createAppPreferences(cookie) {
|
|
|
33
35
|
storage: createCookieStorage(PREFERENCE_COOKIES.accent, { cookie })
|
|
34
36
|
}),
|
|
35
37
|
device,
|
|
36
|
-
screen: createScreen(device)
|
|
38
|
+
screen: createScreen(device),
|
|
39
|
+
view: createPreference({
|
|
40
|
+
values: VIEWS,
|
|
41
|
+
defaultValue: "grid",
|
|
42
|
+
attribute: "data-view",
|
|
43
|
+
global: true,
|
|
44
|
+
storage: createCookieStorage(PREFERENCE_COOKIES.view, { cookie })
|
|
45
|
+
})
|
|
37
46
|
};
|
|
38
47
|
}
|
|
39
48
|
function createScreen(device) {
|
|
@@ -54,11 +63,12 @@ function createScreen(device) {
|
|
|
54
63
|
};
|
|
55
64
|
}
|
|
56
65
|
function preferenceAttributes(cookie) {
|
|
57
|
-
const { colorScheme, accent, device } = createAppPreferences(cookie);
|
|
66
|
+
const { colorScheme, accent, device, view } = createAppPreferences(cookie);
|
|
58
67
|
return {
|
|
59
68
|
[colorScheme.attribute]: colorScheme.initialState.value,
|
|
60
69
|
[accent.attribute]: accent.initialState.value,
|
|
61
|
-
[device.attribute]: device.initialState.value
|
|
70
|
+
[device.attribute]: device.initialState.value,
|
|
71
|
+
[view.attribute]: view.initialState.value
|
|
62
72
|
};
|
|
63
73
|
}
|
|
64
74
|
function preferencesScript(cookie) {
|
|
@@ -71,6 +81,7 @@ export {
|
|
|
71
81
|
ACCENTS,
|
|
72
82
|
DEVICES,
|
|
73
83
|
MOBILE_QUERY,
|
|
84
|
+
VIEWS,
|
|
74
85
|
PREFERENCE_COOKIES,
|
|
75
86
|
createAppPreferences,
|
|
76
87
|
preferenceAttributes,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAppPreferences
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-23GWTX3S.js";
|
|
4
4
|
|
|
5
5
|
// src/theme.tsx
|
|
6
6
|
import { Preferences, usePreference } from "@ui-sdk/react/preferences";
|
|
@@ -19,7 +19,8 @@ function PreferencesProvider({
|
|
|
19
19
|
preferences: [
|
|
20
20
|
preferences.colorScheme,
|
|
21
21
|
preferences.accent,
|
|
22
|
-
preferences.device
|
|
22
|
+
preferences.device,
|
|
23
|
+
preferences.view
|
|
23
24
|
],
|
|
24
25
|
children
|
|
25
26
|
}
|
|
@@ -63,10 +64,21 @@ function useAccent() {
|
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
66
|
}
|
|
67
|
+
function useView() {
|
|
68
|
+
const { view } = usePreferences();
|
|
69
|
+
const { value } = usePreference(view);
|
|
70
|
+
return {
|
|
71
|
+
view: value,
|
|
72
|
+
views: view.values,
|
|
73
|
+
setView: (next) => view.set(next),
|
|
74
|
+
toggleView: () => view.set(value === "grid" ? "list" : "grid")
|
|
75
|
+
};
|
|
76
|
+
}
|
|
66
77
|
|
|
67
78
|
export {
|
|
68
79
|
PreferencesProvider,
|
|
69
80
|
usePreferences,
|
|
70
81
|
useTheme,
|
|
71
|
-
useAccent
|
|
82
|
+
useAccent,
|
|
83
|
+
useView
|
|
72
84
|
};
|
package/dist/hooks/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "../chunk-D6TULSM6.js";
|
|
12
12
|
import {
|
|
13
13
|
useMediaQuery
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-53MRWZE4.js";
|
|
15
15
|
import "../chunk-VFDNWPOI.js";
|
|
16
16
|
import "../chunk-COPQJFDI.js";
|
|
17
17
|
import "../chunk-MZBLIA6C.js";
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
isNativeApp
|
|
32
32
|
} from "../chunk-2LD63YUK.js";
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-VFN3HOYP.js";
|
|
34
|
+
import "../chunk-23GWTX3S.js";
|
|
35
35
|
|
|
36
36
|
// src/hooks/useSearchParams.ts
|
|
37
37
|
import {
|
package/dist/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ import * as _ui_sdk_core from '@ui-sdk/core';
|
|
|
7
7
|
import { ColorSchemeValue } from '@ui-sdk/core';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { ReactNode } from 'react';
|
|
10
|
+
import { V as View } from './preferences-CvWGOnty.js';
|
|
10
11
|
import '@bprogress/next/app';
|
|
11
12
|
|
|
12
|
-
/** One set of preferences per request, created from its cookies, as ui-sdk's server rendering docs describe. */
|
|
13
13
|
declare function PreferencesProvider({ cookie, children, }: {
|
|
14
14
|
cookie?: string | null;
|
|
15
15
|
children: ReactNode;
|
|
@@ -111,8 +111,40 @@ declare function usePreferences(): {
|
|
|
111
111
|
get: () => "mobile" | "desktop";
|
|
112
112
|
subscribe(listener: () => void): () => void;
|
|
113
113
|
};
|
|
114
|
+
view: {
|
|
115
|
+
attribute: `data-${string}`;
|
|
116
|
+
global: boolean;
|
|
117
|
+
values: readonly ("grid" | "list")[];
|
|
118
|
+
defaultValue: "grid" | "list";
|
|
119
|
+
storage: {
|
|
120
|
+
id: string;
|
|
121
|
+
kind: "local" | "session" | "cookie";
|
|
122
|
+
readsOnServer: boolean;
|
|
123
|
+
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
124
|
+
available: () => boolean;
|
|
125
|
+
get: () => string | null;
|
|
126
|
+
set: (value: string) => boolean;
|
|
127
|
+
remove: () => boolean;
|
|
128
|
+
subscribe(listener: (value: string | null) => void): () => void;
|
|
129
|
+
} | undefined;
|
|
130
|
+
initialState: {
|
|
131
|
+
value: "grid" | "list";
|
|
132
|
+
};
|
|
133
|
+
get: () => {
|
|
134
|
+
value: "grid" | "list";
|
|
135
|
+
};
|
|
136
|
+
set: (next: "grid" | "list", change?: {
|
|
137
|
+
reason?: _ui_sdk_core.ChangeReason;
|
|
138
|
+
event?: Event;
|
|
139
|
+
}) => boolean;
|
|
140
|
+
subscribe: (listener: (state: {
|
|
141
|
+
value: "grid" | "list";
|
|
142
|
+
}) => void) => () => void;
|
|
143
|
+
follow: <Key extends string>(store: _ui_sdk_core.PreferenceStore<Key, {
|
|
144
|
+
value: "grid" | "list";
|
|
145
|
+
}>, key: Key) => () => void;
|
|
146
|
+
};
|
|
114
147
|
};
|
|
115
|
-
/** The theme as next-themes shaped it, backed by ui-sdk's color scheme. */
|
|
116
148
|
declare function useTheme(): {
|
|
117
149
|
theme: ColorSchemeValue;
|
|
118
150
|
themes: readonly ("dark" | "light" | "system")[];
|
|
@@ -120,11 +152,16 @@ declare function useTheme(): {
|
|
|
120
152
|
resolvedTheme: "dark" | "light" | undefined;
|
|
121
153
|
setTheme: (next: string) => void;
|
|
122
154
|
};
|
|
123
|
-
/** The accent theme, applied as `data-accent` on `<html>`. */
|
|
124
155
|
declare function useAccent(): {
|
|
125
156
|
accent: "gold" | "violet" | "slate" | "mint";
|
|
126
157
|
accents: readonly ("gold" | "violet" | "slate" | "mint")[];
|
|
127
158
|
setAccent: (next: string) => void;
|
|
128
159
|
};
|
|
160
|
+
declare function useView(): {
|
|
161
|
+
view: "grid" | "list";
|
|
162
|
+
views: readonly ("grid" | "list")[];
|
|
163
|
+
setView: (next: View) => boolean;
|
|
164
|
+
toggleView: () => boolean;
|
|
165
|
+
};
|
|
129
166
|
|
|
130
|
-
export { PreferencesProvider, useAccent, usePreferences, useTheme };
|
|
167
|
+
export { PreferencesProvider, useAccent, usePreferences, useTheme, useView };
|
package/dist/index.js
CHANGED
|
@@ -3,12 +3,13 @@ import {
|
|
|
3
3
|
PreferencesProvider,
|
|
4
4
|
useAccent,
|
|
5
5
|
usePreferences,
|
|
6
|
-
useTheme
|
|
7
|
-
|
|
6
|
+
useTheme,
|
|
7
|
+
useView
|
|
8
|
+
} from "./chunk-VFN3HOYP.js";
|
|
8
9
|
import {
|
|
9
10
|
TopLoader
|
|
10
11
|
} from "./chunk-3ZGQJTWY.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-23GWTX3S.js";
|
|
12
13
|
import {
|
|
13
14
|
BellIcon,
|
|
14
15
|
IconSwap,
|
|
@@ -28,5 +29,6 @@ export {
|
|
|
28
29
|
TopLoader,
|
|
29
30
|
useAccent,
|
|
30
31
|
usePreferences,
|
|
31
|
-
useTheme
|
|
32
|
+
useTheme,
|
|
33
|
+
useView
|
|
32
34
|
};
|
package/dist/layout.js
CHANGED
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { A as ACCENTS, a as Accent, b as AppPreferences, D as DEVICES, c as Device, M as MOBILE_QUERY, P as PREFERENCE_COOKIES, d as VIEWS, V as View, e as createAppPreferences, p as preferenceAttributes, f as preferencesScript } from '../preferences-CvWGOnty.js';
|
|
2
|
+
import '@ui-sdk/core';
|
|
2
3
|
|
|
3
4
|
type PluginListenerHandle = {
|
|
4
5
|
remove: () => Promise<void>;
|
|
@@ -199,122 +200,4 @@ declare function pickNativeChooserImageFiles({ isNative, limit, title, }: {
|
|
|
199
200
|
title?: string;
|
|
200
201
|
}): Promise<File[] | null>;
|
|
201
202
|
|
|
202
|
-
|
|
203
|
-
type Accent = (typeof ACCENTS)[number];
|
|
204
|
-
declare const DEVICES: readonly ["mobile", "desktop"];
|
|
205
|
-
type Device = (typeof DEVICES)[number];
|
|
206
|
-
declare const MOBILE_QUERY = "(max-width: 767px)";
|
|
207
|
-
declare const PREFERENCE_COOKIES: {
|
|
208
|
-
readonly colorScheme: "color-scheme";
|
|
209
|
-
readonly accent: "accent";
|
|
210
|
-
readonly device: "device";
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* The app's saved preferences, kept in cookies so the server renders them too.
|
|
214
|
-
* Create them once per request from its `Cookie` header.
|
|
215
|
-
*/
|
|
216
|
-
declare function createAppPreferences(cookie?: string | null): {
|
|
217
|
-
colorScheme: {
|
|
218
|
-
attribute: `data-${string}`;
|
|
219
|
-
global: boolean;
|
|
220
|
-
values: readonly ("system" | "light" | "dark")[];
|
|
221
|
-
defaultValue: "system" | "light" | "dark";
|
|
222
|
-
storage: {
|
|
223
|
-
id: string;
|
|
224
|
-
kind: "local" | "session" | "cookie";
|
|
225
|
-
readsOnServer: boolean;
|
|
226
|
-
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
227
|
-
available: () => boolean;
|
|
228
|
-
get: () => string | null;
|
|
229
|
-
set: (value: string) => boolean;
|
|
230
|
-
remove: () => boolean;
|
|
231
|
-
subscribe(listener: (value: string | null) => void): () => void;
|
|
232
|
-
} | undefined;
|
|
233
|
-
initialState: _ui_sdk_core.ColorSchemeState;
|
|
234
|
-
get: () => _ui_sdk_core.ColorSchemeState;
|
|
235
|
-
set: (next: "system" | "light" | "dark", change?: {
|
|
236
|
-
reason?: _ui_sdk_core.ChangeReason;
|
|
237
|
-
event?: Event;
|
|
238
|
-
}) => boolean;
|
|
239
|
-
subscribe: (listener: (state: _ui_sdk_core.ColorSchemeState) => void) => () => void;
|
|
240
|
-
follow: <Key extends string>(store: _ui_sdk_core.ColorSchemeStore<Key>, key: Key) => () => void;
|
|
241
|
-
};
|
|
242
|
-
accent: {
|
|
243
|
-
attribute: `data-${string}`;
|
|
244
|
-
global: boolean;
|
|
245
|
-
values: readonly ("gold" | "violet" | "slate" | "mint")[];
|
|
246
|
-
defaultValue: "gold" | "violet" | "slate" | "mint";
|
|
247
|
-
storage: {
|
|
248
|
-
id: string;
|
|
249
|
-
kind: "local" | "session" | "cookie";
|
|
250
|
-
readsOnServer: boolean;
|
|
251
|
-
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
252
|
-
available: () => boolean;
|
|
253
|
-
get: () => string | null;
|
|
254
|
-
set: (value: string) => boolean;
|
|
255
|
-
remove: () => boolean;
|
|
256
|
-
subscribe(listener: (value: string | null) => void): () => void;
|
|
257
|
-
} | undefined;
|
|
258
|
-
initialState: {
|
|
259
|
-
value: "gold" | "violet" | "slate" | "mint";
|
|
260
|
-
};
|
|
261
|
-
get: () => {
|
|
262
|
-
value: "gold" | "violet" | "slate" | "mint";
|
|
263
|
-
};
|
|
264
|
-
set: (next: "gold" | "violet" | "slate" | "mint", change?: {
|
|
265
|
-
reason?: _ui_sdk_core.ChangeReason;
|
|
266
|
-
event?: Event;
|
|
267
|
-
}) => boolean;
|
|
268
|
-
subscribe: (listener: (state: {
|
|
269
|
-
value: "gold" | "violet" | "slate" | "mint";
|
|
270
|
-
}) => void) => () => void;
|
|
271
|
-
follow: <Key extends string>(store: _ui_sdk_core.PreferenceStore<Key, {
|
|
272
|
-
value: "gold" | "violet" | "slate" | "mint";
|
|
273
|
-
}>, key: Key) => () => void;
|
|
274
|
-
};
|
|
275
|
-
device: {
|
|
276
|
-
attribute: `data-${string}`;
|
|
277
|
-
global: boolean;
|
|
278
|
-
values: readonly ("mobile" | "desktop")[];
|
|
279
|
-
defaultValue: "mobile" | "desktop";
|
|
280
|
-
storage: {
|
|
281
|
-
id: string;
|
|
282
|
-
kind: "local" | "session" | "cookie";
|
|
283
|
-
readsOnServer: boolean;
|
|
284
|
-
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
285
|
-
available: () => boolean;
|
|
286
|
-
get: () => string | null;
|
|
287
|
-
set: (value: string) => boolean;
|
|
288
|
-
remove: () => boolean;
|
|
289
|
-
subscribe(listener: (value: string | null) => void): () => void;
|
|
290
|
-
} | undefined;
|
|
291
|
-
initialState: {
|
|
292
|
-
value: "mobile" | "desktop";
|
|
293
|
-
};
|
|
294
|
-
get: () => {
|
|
295
|
-
value: "mobile" | "desktop";
|
|
296
|
-
};
|
|
297
|
-
set: (next: "mobile" | "desktop", change?: {
|
|
298
|
-
reason?: _ui_sdk_core.ChangeReason;
|
|
299
|
-
event?: Event;
|
|
300
|
-
}) => boolean;
|
|
301
|
-
subscribe: (listener: (state: {
|
|
302
|
-
value: "mobile" | "desktop";
|
|
303
|
-
}) => void) => () => void;
|
|
304
|
-
follow: <Key extends string>(store: _ui_sdk_core.PreferenceStore<Key, {
|
|
305
|
-
value: "mobile" | "desktop";
|
|
306
|
-
}>, key: Key) => () => void;
|
|
307
|
-
};
|
|
308
|
-
screen: {
|
|
309
|
-
initialState: "mobile" | "desktop";
|
|
310
|
-
get: () => "mobile" | "desktop";
|
|
311
|
-
subscribe(listener: () => void): () => void;
|
|
312
|
-
};
|
|
313
|
-
};
|
|
314
|
-
type AppPreferences = ReturnType<typeof createAppPreferences>;
|
|
315
|
-
/** The `<html>` attributes for a request's saved preferences. */
|
|
316
|
-
declare function preferenceAttributes(cookie?: string | null): Record<`data-${string}`, string>;
|
|
317
|
-
/** Sets the saved preferences on `<html>` while the page parses, before it paints. */
|
|
318
|
-
declare function preferencesScript(cookie?: string | null): string;
|
|
319
|
-
|
|
320
|
-
export { ACCENTS, type Accent, type AppPreferences, DEVICES, type Device, MOBILE_QUERY, type NativeSharePayload, type NativeSharedFile, type NativeUpdateInfo, type NativeUpdateState, PREFERENCE_COOKIES, createAppPreferences, getNativeAppPlugin, getNativeAppSettingsPlugin, getNativeBrowserPlugin, getNativeCameraPlugin, getNativeImagePickerPlugin, getNativeInAppUpdatePlugin, getNativePaymentPlugin, getNativePlatform, getNativeShareFilePlugin, getNativeSharePlugin, getNativeShareTargetPlugin, getNativeStatusBarPlugin, getNativeThemePlugin, isNativeApp, nativeSharedFileToFile, openExternalUrl, openNativeAppSettings, openUpiPaymentUrl, pickNativeChooserImageFiles, pickNativeImageFiles, preferenceAttributes, preferencesScript, saveNativeShareImage, shareNativeOrWeb };
|
|
203
|
+
export { type NativeSharePayload, type NativeSharedFile, type NativeUpdateInfo, type NativeUpdateState, getNativeAppPlugin, getNativeAppSettingsPlugin, getNativeBrowserPlugin, getNativeCameraPlugin, getNativeImagePickerPlugin, getNativeInAppUpdatePlugin, getNativePaymentPlugin, getNativePlatform, getNativeShareFilePlugin, getNativeSharePlugin, getNativeShareTargetPlugin, getNativeStatusBarPlugin, getNativeThemePlugin, isNativeApp, nativeSharedFileToFile, openExternalUrl, openNativeAppSettings, openUpiPaymentUrl, pickNativeChooserImageFiles, pickNativeImageFiles, saveNativeShareImage, shareNativeOrWeb };
|
package/dist/lib/index.js
CHANGED
|
@@ -27,15 +27,17 @@ import {
|
|
|
27
27
|
DEVICES,
|
|
28
28
|
MOBILE_QUERY,
|
|
29
29
|
PREFERENCE_COOKIES,
|
|
30
|
+
VIEWS,
|
|
30
31
|
createAppPreferences,
|
|
31
32
|
preferenceAttributes,
|
|
32
33
|
preferencesScript
|
|
33
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-23GWTX3S.js";
|
|
34
35
|
export {
|
|
35
36
|
ACCENTS,
|
|
36
37
|
DEVICES,
|
|
37
38
|
MOBILE_QUERY,
|
|
38
39
|
PREFERENCE_COOKIES,
|
|
40
|
+
VIEWS,
|
|
39
41
|
createAppPreferences,
|
|
40
42
|
getNativeAppPlugin,
|
|
41
43
|
getNativeAppSettingsPlugin,
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as _ui_sdk_core from '@ui-sdk/core';
|
|
2
|
+
|
|
3
|
+
declare const ACCENTS: readonly ["slate", "violet", "mint", "gold"];
|
|
4
|
+
type Accent = (typeof ACCENTS)[number];
|
|
5
|
+
declare const DEVICES: readonly ["mobile", "desktop"];
|
|
6
|
+
type Device = (typeof DEVICES)[number];
|
|
7
|
+
declare const MOBILE_QUERY = "(max-width: 767px)";
|
|
8
|
+
/** How a collection of items is laid out: a grid of cards or a list of rows. */
|
|
9
|
+
declare const VIEWS: readonly ["grid", "list"];
|
|
10
|
+
type View = (typeof VIEWS)[number];
|
|
11
|
+
declare const PREFERENCE_COOKIES: {
|
|
12
|
+
readonly colorScheme: "color-scheme";
|
|
13
|
+
readonly accent: "accent";
|
|
14
|
+
readonly device: "device";
|
|
15
|
+
readonly view: "view";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The app's saved preferences, kept in cookies so the server renders them too.
|
|
19
|
+
* Create them once per request from its `Cookie` header.
|
|
20
|
+
*/
|
|
21
|
+
declare function createAppPreferences(cookie?: string | null): {
|
|
22
|
+
colorScheme: {
|
|
23
|
+
attribute: `data-${string}`;
|
|
24
|
+
global: boolean;
|
|
25
|
+
values: readonly ("system" | "light" | "dark")[];
|
|
26
|
+
defaultValue: "system" | "light" | "dark";
|
|
27
|
+
storage: {
|
|
28
|
+
id: string;
|
|
29
|
+
kind: "local" | "session" | "cookie";
|
|
30
|
+
readsOnServer: boolean;
|
|
31
|
+
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
32
|
+
available: () => boolean;
|
|
33
|
+
get: () => string | null;
|
|
34
|
+
set: (value: string) => boolean;
|
|
35
|
+
remove: () => boolean;
|
|
36
|
+
subscribe(listener: (value: string | null) => void): () => void;
|
|
37
|
+
} | undefined;
|
|
38
|
+
initialState: _ui_sdk_core.ColorSchemeState;
|
|
39
|
+
get: () => _ui_sdk_core.ColorSchemeState;
|
|
40
|
+
set: (next: "system" | "light" | "dark", change?: {
|
|
41
|
+
reason?: _ui_sdk_core.ChangeReason;
|
|
42
|
+
event?: Event;
|
|
43
|
+
}) => boolean;
|
|
44
|
+
subscribe: (listener: (state: _ui_sdk_core.ColorSchemeState) => void) => () => void;
|
|
45
|
+
follow: <Key extends string>(store: _ui_sdk_core.ColorSchemeStore<Key>, key: Key) => () => void;
|
|
46
|
+
};
|
|
47
|
+
accent: {
|
|
48
|
+
attribute: `data-${string}`;
|
|
49
|
+
global: boolean;
|
|
50
|
+
values: readonly ("gold" | "violet" | "slate" | "mint")[];
|
|
51
|
+
defaultValue: "gold" | "violet" | "slate" | "mint";
|
|
52
|
+
storage: {
|
|
53
|
+
id: string;
|
|
54
|
+
kind: "local" | "session" | "cookie";
|
|
55
|
+
readsOnServer: boolean;
|
|
56
|
+
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
57
|
+
available: () => boolean;
|
|
58
|
+
get: () => string | null;
|
|
59
|
+
set: (value: string) => boolean;
|
|
60
|
+
remove: () => boolean;
|
|
61
|
+
subscribe(listener: (value: string | null) => void): () => void;
|
|
62
|
+
} | undefined;
|
|
63
|
+
initialState: {
|
|
64
|
+
value: "gold" | "violet" | "slate" | "mint";
|
|
65
|
+
};
|
|
66
|
+
get: () => {
|
|
67
|
+
value: "gold" | "violet" | "slate" | "mint";
|
|
68
|
+
};
|
|
69
|
+
set: (next: "gold" | "violet" | "slate" | "mint", change?: {
|
|
70
|
+
reason?: _ui_sdk_core.ChangeReason;
|
|
71
|
+
event?: Event;
|
|
72
|
+
}) => boolean;
|
|
73
|
+
subscribe: (listener: (state: {
|
|
74
|
+
value: "gold" | "violet" | "slate" | "mint";
|
|
75
|
+
}) => void) => () => void;
|
|
76
|
+
follow: <Key extends string>(store: _ui_sdk_core.PreferenceStore<Key, {
|
|
77
|
+
value: "gold" | "violet" | "slate" | "mint";
|
|
78
|
+
}>, key: Key) => () => void;
|
|
79
|
+
};
|
|
80
|
+
device: {
|
|
81
|
+
attribute: `data-${string}`;
|
|
82
|
+
global: boolean;
|
|
83
|
+
values: readonly ("mobile" | "desktop")[];
|
|
84
|
+
defaultValue: "mobile" | "desktop";
|
|
85
|
+
storage: {
|
|
86
|
+
id: string;
|
|
87
|
+
kind: "local" | "session" | "cookie";
|
|
88
|
+
readsOnServer: boolean;
|
|
89
|
+
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
90
|
+
available: () => boolean;
|
|
91
|
+
get: () => string | null;
|
|
92
|
+
set: (value: string) => boolean;
|
|
93
|
+
remove: () => boolean;
|
|
94
|
+
subscribe(listener: (value: string | null) => void): () => void;
|
|
95
|
+
} | undefined;
|
|
96
|
+
initialState: {
|
|
97
|
+
value: "mobile" | "desktop";
|
|
98
|
+
};
|
|
99
|
+
get: () => {
|
|
100
|
+
value: "mobile" | "desktop";
|
|
101
|
+
};
|
|
102
|
+
set: (next: "mobile" | "desktop", change?: {
|
|
103
|
+
reason?: _ui_sdk_core.ChangeReason;
|
|
104
|
+
event?: Event;
|
|
105
|
+
}) => boolean;
|
|
106
|
+
subscribe: (listener: (state: {
|
|
107
|
+
value: "mobile" | "desktop";
|
|
108
|
+
}) => void) => () => void;
|
|
109
|
+
follow: <Key extends string>(store: _ui_sdk_core.PreferenceStore<Key, {
|
|
110
|
+
value: "mobile" | "desktop";
|
|
111
|
+
}>, key: Key) => () => void;
|
|
112
|
+
};
|
|
113
|
+
screen: {
|
|
114
|
+
initialState: "mobile" | "desktop";
|
|
115
|
+
get: () => "mobile" | "desktop";
|
|
116
|
+
subscribe(listener: () => void): () => void;
|
|
117
|
+
};
|
|
118
|
+
view: {
|
|
119
|
+
attribute: `data-${string}`;
|
|
120
|
+
global: boolean;
|
|
121
|
+
values: readonly ("grid" | "list")[];
|
|
122
|
+
defaultValue: "grid" | "list";
|
|
123
|
+
storage: {
|
|
124
|
+
id: string;
|
|
125
|
+
kind: "local" | "session" | "cookie";
|
|
126
|
+
readsOnServer: boolean;
|
|
127
|
+
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
128
|
+
available: () => boolean;
|
|
129
|
+
get: () => string | null;
|
|
130
|
+
set: (value: string) => boolean;
|
|
131
|
+
remove: () => boolean;
|
|
132
|
+
subscribe(listener: (value: string | null) => void): () => void;
|
|
133
|
+
} | undefined;
|
|
134
|
+
initialState: {
|
|
135
|
+
value: "grid" | "list";
|
|
136
|
+
};
|
|
137
|
+
get: () => {
|
|
138
|
+
value: "grid" | "list";
|
|
139
|
+
};
|
|
140
|
+
set: (next: "grid" | "list", change?: {
|
|
141
|
+
reason?: _ui_sdk_core.ChangeReason;
|
|
142
|
+
event?: Event;
|
|
143
|
+
}) => boolean;
|
|
144
|
+
subscribe: (listener: (state: {
|
|
145
|
+
value: "grid" | "list";
|
|
146
|
+
}) => void) => () => void;
|
|
147
|
+
follow: <Key extends string>(store: _ui_sdk_core.PreferenceStore<Key, {
|
|
148
|
+
value: "grid" | "list";
|
|
149
|
+
}>, key: Key) => () => void;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
type AppPreferences = ReturnType<typeof createAppPreferences>;
|
|
153
|
+
/** The `<html>` attributes for a request's saved preferences. */
|
|
154
|
+
declare function preferenceAttributes(cookie?: string | null): Record<`data-${string}`, string>;
|
|
155
|
+
/** Sets the saved preferences on `<html>` while the page parses, before it paints. */
|
|
156
|
+
declare function preferencesScript(cookie?: string | null): string;
|
|
157
|
+
|
|
158
|
+
export { ACCENTS as A, DEVICES as D, MOBILE_QUERY as M, PREFERENCE_COOKIES as P, type View as V, type Accent as a, type AppPreferences as b, type Device as c, VIEWS as d, createAppPreferences as e, preferencesScript as f, preferenceAttributes as p };
|
package/dist/provider.js
CHANGED
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
PreferencesProvider,
|
|
12
12
|
usePreferences,
|
|
13
13
|
useTheme
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VFN3HOYP.js";
|
|
15
15
|
import {
|
|
16
16
|
TopLoader
|
|
17
17
|
} from "./chunk-3ZGQJTWY.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-23GWTX3S.js";
|
|
19
19
|
|
|
20
20
|
// src/provider.tsx
|
|
21
21
|
import * as React from "react";
|
package/dist/ui/bridge.js
CHANGED
package/dist/ui/code-block.js
CHANGED
package/dist/ui/drawer-dialog.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "../chunk-UZGJXAFX.js";
|
|
5
5
|
import {
|
|
6
6
|
useMediaQuery
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-53MRWZE4.js";
|
|
8
8
|
import {
|
|
9
9
|
Button
|
|
10
10
|
} from "../chunk-DVNTJNDP.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-VFN3HOYP.js";
|
|
12
|
+
import "../chunk-23GWTX3S.js";
|
|
13
13
|
|
|
14
14
|
// src/ui/drawer-dialog.tsx
|
|
15
15
|
import { Xmark } from "@gravity-ui/icons";
|
package/dist/ui/farmer/div.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
useMediaQuery
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-53MRWZE4.js";
|
|
5
|
+
import "../../chunk-VFN3HOYP.js";
|
|
6
|
+
import "../../chunk-23GWTX3S.js";
|
|
7
7
|
|
|
8
8
|
// src/ui/farmer/div.tsx
|
|
9
9
|
import { motion } from "motion/react";
|
package/dist/ui/sonner.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "../chunk-ILKXRTV2.js";
|
|
5
5
|
import {
|
|
6
6
|
useTheme
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-VFN3HOYP.js";
|
|
8
|
+
import "../chunk-23GWTX3S.js";
|
|
9
9
|
|
|
10
10
|
// src/ui/theme-switcher.tsx
|
|
11
11
|
import { Display, Moon, Sun } from "@gravity-ui/icons";
|
package/dist/ui/theme-toggle.js
CHANGED