@nersh/render 0.1.0 → 0.2.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/index.cjs +107 -436
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +196 -3
- package/dist/index.d.ts +196 -3
- package/dist/index.mjs +102 -435
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2494,8 +2494,8 @@ var themes = {
|
|
|
2494
2494
|
}
|
|
2495
2495
|
};
|
|
2496
2496
|
|
|
2497
|
-
// src/lib/skins/
|
|
2498
|
-
var
|
|
2497
|
+
// src/lib/skins/presets.ts
|
|
2498
|
+
var PRESET_SKIN_IDS = Object.keys(themes);
|
|
2499
2499
|
function tintedShadows(accentPct, base, alpha) {
|
|
2500
2500
|
const color = (a) => `color-mix(in srgb, color-mix(in srgb, var(--accent) ${accentPct}%, ${base}), transparent ${100 - a}%)`;
|
|
2501
2501
|
return {
|
|
@@ -2530,7 +2530,7 @@ function modeTokens(mode) {
|
|
|
2530
2530
|
accentFg: mode["--primary-foreground"]
|
|
2531
2531
|
};
|
|
2532
2532
|
}
|
|
2533
|
-
function
|
|
2533
|
+
function buildPresetSkin(id) {
|
|
2534
2534
|
const theme = themes[id];
|
|
2535
2535
|
return {
|
|
2536
2536
|
id,
|
|
@@ -2553,7 +2553,7 @@ function buildShadcnPresetSkin(id) {
|
|
|
2553
2553
|
})
|
|
2554
2554
|
};
|
|
2555
2555
|
}
|
|
2556
|
-
var
|
|
2556
|
+
var PRESET_SKINS = PRESET_SKIN_IDS.map((id) => buildPresetSkin(id));
|
|
2557
2557
|
|
|
2558
2558
|
// src/lib/componentLibrary/presetBridge.ts
|
|
2559
2559
|
import {
|
|
@@ -3068,7 +3068,7 @@ __export(core_exports2, {
|
|
|
3068
3068
|
parse: () => parse,
|
|
3069
3069
|
parseAsync: () => parseAsync,
|
|
3070
3070
|
prettifyError: () => prettifyError,
|
|
3071
|
-
process: () =>
|
|
3071
|
+
process: () => process,
|
|
3072
3072
|
regexes: () => regexes_exports,
|
|
3073
3073
|
registry: () => registry,
|
|
3074
3074
|
safeDecode: () => safeDecode,
|
|
@@ -3255,10 +3255,10 @@ function jsonStringifyReplacer(_, value) {
|
|
|
3255
3255
|
return value;
|
|
3256
3256
|
}
|
|
3257
3257
|
function cached(getter) {
|
|
3258
|
-
const
|
|
3258
|
+
const set2 = false;
|
|
3259
3259
|
return {
|
|
3260
3260
|
get value() {
|
|
3261
|
-
if (!
|
|
3261
|
+
if (!set2) {
|
|
3262
3262
|
const value = getter();
|
|
3263
3263
|
Object.defineProperty(this, "value", { value });
|
|
3264
3264
|
return value;
|
|
@@ -13584,7 +13584,7 @@ function initializeContext(params) {
|
|
|
13584
13584
|
external: (_i = params == null ? void 0 : params.external) != null ? _i : void 0
|
|
13585
13585
|
};
|
|
13586
13586
|
}
|
|
13587
|
-
function
|
|
13587
|
+
function process(schema43, ctx, _params = { path: [], schemaPath: [] }) {
|
|
13588
13588
|
var _a4, _b, _c;
|
|
13589
13589
|
var _a3;
|
|
13590
13590
|
const def = schema43._zod.def;
|
|
@@ -13621,7 +13621,7 @@ function process2(schema43, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
13621
13621
|
if (parent) {
|
|
13622
13622
|
if (!result.ref)
|
|
13623
13623
|
result.ref = parent;
|
|
13624
|
-
|
|
13624
|
+
process(parent, ctx, params);
|
|
13625
13625
|
ctx.seen.get(parent).isParent = true;
|
|
13626
13626
|
}
|
|
13627
13627
|
}
|
|
@@ -13680,7 +13680,7 @@ function extractDefs(ctx, schema43) {
|
|
|
13680
13680
|
return;
|
|
13681
13681
|
}
|
|
13682
13682
|
const seen = entry[1];
|
|
13683
|
-
const { ref
|
|
13683
|
+
const { ref, defId } = makeURI(entry);
|
|
13684
13684
|
seen.def = __spreadValues({}, seen.schema);
|
|
13685
13685
|
if (defId)
|
|
13686
13686
|
seen.defId = defId;
|
|
@@ -13688,7 +13688,7 @@ function extractDefs(ctx, schema43) {
|
|
|
13688
13688
|
for (const key in schema44) {
|
|
13689
13689
|
delete schema44[key];
|
|
13690
13690
|
}
|
|
13691
|
-
schema44.$ref =
|
|
13691
|
+
schema44.$ref = ref;
|
|
13692
13692
|
};
|
|
13693
13693
|
if (ctx.cycles === "throw") {
|
|
13694
13694
|
for (const entry of ctx.seen.entries()) {
|
|
@@ -13742,11 +13742,11 @@ function finalize(ctx, schema43) {
|
|
|
13742
13742
|
return;
|
|
13743
13743
|
const schema44 = (_a4 = seen.def) != null ? _a4 : seen.schema;
|
|
13744
13744
|
const _cached = __spreadValues({}, schema44);
|
|
13745
|
-
const
|
|
13745
|
+
const ref = seen.ref;
|
|
13746
13746
|
seen.ref = null;
|
|
13747
|
-
if (
|
|
13748
|
-
flattenRef(
|
|
13749
|
-
const refSeen = ctx.seen.get(
|
|
13747
|
+
if (ref) {
|
|
13748
|
+
flattenRef(ref);
|
|
13749
|
+
const refSeen = ctx.seen.get(ref);
|
|
13750
13750
|
const refSchema = refSeen.schema;
|
|
13751
13751
|
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
13752
13752
|
schema44.allOf = (_b2 = schema44.allOf) != null ? _b2 : [];
|
|
@@ -13755,7 +13755,7 @@ function finalize(ctx, schema43) {
|
|
|
13755
13755
|
Object.assign(schema44, refSchema);
|
|
13756
13756
|
}
|
|
13757
13757
|
Object.assign(schema44, _cached);
|
|
13758
|
-
const isParentRef = zodSchema._zod.parent ===
|
|
13758
|
+
const isParentRef = zodSchema._zod.parent === ref;
|
|
13759
13759
|
if (isParentRef) {
|
|
13760
13760
|
for (const key in schema44) {
|
|
13761
13761
|
if (key === "$ref" || key === "allOf")
|
|
@@ -13776,7 +13776,7 @@ function finalize(ctx, schema43) {
|
|
|
13776
13776
|
}
|
|
13777
13777
|
}
|
|
13778
13778
|
const parent = zodSchema._zod.parent;
|
|
13779
|
-
if (parent && parent !==
|
|
13779
|
+
if (parent && parent !== ref) {
|
|
13780
13780
|
flattenRef(parent);
|
|
13781
13781
|
const parentSeen = ctx.seen.get(parent);
|
|
13782
13782
|
if (parentSeen == null ? void 0 : parentSeen.schema.$ref) {
|
|
@@ -13905,14 +13905,14 @@ function isTransforming(_schema, _ctx) {
|
|
|
13905
13905
|
}
|
|
13906
13906
|
var createToJSONSchemaMethod = (schema43, processors = {}) => (params) => {
|
|
13907
13907
|
const ctx = initializeContext(__spreadProps(__spreadValues({}, params), { processors }));
|
|
13908
|
-
|
|
13908
|
+
process(schema43, ctx);
|
|
13909
13909
|
extractDefs(ctx, schema43);
|
|
13910
13910
|
return finalize(ctx, schema43);
|
|
13911
13911
|
};
|
|
13912
13912
|
var createStandardJSONSchemaMethod = (schema43, io, processors = {}) => (params) => {
|
|
13913
13913
|
const { libraryOptions, target } = params != null ? params : {};
|
|
13914
13914
|
const ctx = initializeContext(__spreadProps(__spreadValues({}, libraryOptions != null ? libraryOptions : {}), { target, io, processors }));
|
|
13915
|
-
|
|
13915
|
+
process(schema43, ctx);
|
|
13916
13916
|
extractDefs(ctx, schema43);
|
|
13917
13917
|
return finalize(ctx, schema43);
|
|
13918
13918
|
};
|
|
@@ -14169,7 +14169,7 @@ var arrayProcessor = (schema43, ctx, _json, params) => {
|
|
|
14169
14169
|
if (typeof maximum === "number")
|
|
14170
14170
|
json2.maxItems = maximum;
|
|
14171
14171
|
json2.type = "array";
|
|
14172
|
-
json2.items =
|
|
14172
|
+
json2.items = process(def.element, ctx, __spreadProps(__spreadValues({}, params), { path: [...params.path, "items"] }));
|
|
14173
14173
|
};
|
|
14174
14174
|
var objectProcessor = (schema43, ctx, _json, params) => {
|
|
14175
14175
|
var _a3;
|
|
@@ -14179,7 +14179,7 @@ var objectProcessor = (schema43, ctx, _json, params) => {
|
|
|
14179
14179
|
json2.properties = {};
|
|
14180
14180
|
const shape = def.shape;
|
|
14181
14181
|
for (const key in shape) {
|
|
14182
|
-
json2.properties[key] =
|
|
14182
|
+
json2.properties[key] = process(shape[key], ctx, __spreadProps(__spreadValues({}, params), {
|
|
14183
14183
|
path: [...params.path, "properties", key]
|
|
14184
14184
|
}));
|
|
14185
14185
|
}
|
|
@@ -14201,7 +14201,7 @@ var objectProcessor = (schema43, ctx, _json, params) => {
|
|
|
14201
14201
|
if (ctx.io === "output")
|
|
14202
14202
|
json2.additionalProperties = false;
|
|
14203
14203
|
} else if (def.catchall) {
|
|
14204
|
-
json2.additionalProperties =
|
|
14204
|
+
json2.additionalProperties = process(def.catchall, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14205
14205
|
path: [...params.path, "additionalProperties"]
|
|
14206
14206
|
}));
|
|
14207
14207
|
}
|
|
@@ -14209,7 +14209,7 @@ var objectProcessor = (schema43, ctx, _json, params) => {
|
|
|
14209
14209
|
var unionProcessor = (schema43, ctx, json2, params) => {
|
|
14210
14210
|
const def = schema43._zod.def;
|
|
14211
14211
|
const isExclusive = def.inclusive === false;
|
|
14212
|
-
const options = def.options.map((x, i) =>
|
|
14212
|
+
const options = def.options.map((x, i) => process(x, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14213
14213
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
14214
14214
|
})));
|
|
14215
14215
|
if (isExclusive) {
|
|
@@ -14220,10 +14220,10 @@ var unionProcessor = (schema43, ctx, json2, params) => {
|
|
|
14220
14220
|
};
|
|
14221
14221
|
var intersectionProcessor = (schema43, ctx, json2, params) => {
|
|
14222
14222
|
const def = schema43._zod.def;
|
|
14223
|
-
const a =
|
|
14223
|
+
const a = process(def.left, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14224
14224
|
path: [...params.path, "allOf", 0]
|
|
14225
14225
|
}));
|
|
14226
|
-
const b =
|
|
14226
|
+
const b = process(def.right, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14227
14227
|
path: [...params.path, "allOf", 1]
|
|
14228
14228
|
}));
|
|
14229
14229
|
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
@@ -14239,10 +14239,10 @@ var tupleProcessor = (schema43, ctx, _json, params) => {
|
|
|
14239
14239
|
json2.type = "array";
|
|
14240
14240
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
14241
14241
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
14242
|
-
const prefixItems = def.items.map((x, i) =>
|
|
14242
|
+
const prefixItems = def.items.map((x, i) => process(x, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14243
14243
|
path: [...params.path, prefixPath, i]
|
|
14244
14244
|
})));
|
|
14245
|
-
const rest = def.rest ?
|
|
14245
|
+
const rest = def.rest ? process(def.rest, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14246
14246
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
14247
14247
|
})) : null;
|
|
14248
14248
|
if (ctx.target === "draft-2020-12") {
|
|
@@ -14281,7 +14281,7 @@ var recordProcessor = (schema43, ctx, _json, params) => {
|
|
|
14281
14281
|
const keyBag = keyType._zod.bag;
|
|
14282
14282
|
const patterns = keyBag == null ? void 0 : keyBag.patterns;
|
|
14283
14283
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
14284
|
-
const valueSchema =
|
|
14284
|
+
const valueSchema = process(def.valueType, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14285
14285
|
path: [...params.path, "patternProperties", "*"]
|
|
14286
14286
|
}));
|
|
14287
14287
|
json2.patternProperties = {};
|
|
@@ -14290,11 +14290,11 @@ var recordProcessor = (schema43, ctx, _json, params) => {
|
|
|
14290
14290
|
}
|
|
14291
14291
|
} else {
|
|
14292
14292
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
14293
|
-
json2.propertyNames =
|
|
14293
|
+
json2.propertyNames = process(def.keyType, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14294
14294
|
path: [...params.path, "propertyNames"]
|
|
14295
14295
|
}));
|
|
14296
14296
|
}
|
|
14297
|
-
json2.additionalProperties =
|
|
14297
|
+
json2.additionalProperties = process(def.valueType, ctx, __spreadProps(__spreadValues({}, params), {
|
|
14298
14298
|
path: [...params.path, "additionalProperties"]
|
|
14299
14299
|
}));
|
|
14300
14300
|
}
|
|
@@ -14308,7 +14308,7 @@ var recordProcessor = (schema43, ctx, _json, params) => {
|
|
|
14308
14308
|
};
|
|
14309
14309
|
var nullableProcessor = (schema43, ctx, json2, params) => {
|
|
14310
14310
|
const def = schema43._zod.def;
|
|
14311
|
-
const inner =
|
|
14311
|
+
const inner = process(def.innerType, ctx, params);
|
|
14312
14312
|
const seen = ctx.seen.get(schema43);
|
|
14313
14313
|
if (ctx.target === "openapi-3.0") {
|
|
14314
14314
|
seen.ref = def.innerType;
|
|
@@ -14319,20 +14319,20 @@ var nullableProcessor = (schema43, ctx, json2, params) => {
|
|
|
14319
14319
|
};
|
|
14320
14320
|
var nonoptionalProcessor = (schema43, ctx, _json, params) => {
|
|
14321
14321
|
const def = schema43._zod.def;
|
|
14322
|
-
|
|
14322
|
+
process(def.innerType, ctx, params);
|
|
14323
14323
|
const seen = ctx.seen.get(schema43);
|
|
14324
14324
|
seen.ref = def.innerType;
|
|
14325
14325
|
};
|
|
14326
14326
|
var defaultProcessor = (schema43, ctx, json2, params) => {
|
|
14327
14327
|
const def = schema43._zod.def;
|
|
14328
|
-
|
|
14328
|
+
process(def.innerType, ctx, params);
|
|
14329
14329
|
const seen = ctx.seen.get(schema43);
|
|
14330
14330
|
seen.ref = def.innerType;
|
|
14331
14331
|
json2.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
14332
14332
|
};
|
|
14333
14333
|
var prefaultProcessor = (schema43, ctx, json2, params) => {
|
|
14334
14334
|
const def = schema43._zod.def;
|
|
14335
|
-
|
|
14335
|
+
process(def.innerType, ctx, params);
|
|
14336
14336
|
const seen = ctx.seen.get(schema43);
|
|
14337
14337
|
seen.ref = def.innerType;
|
|
14338
14338
|
if (ctx.io === "input")
|
|
@@ -14340,7 +14340,7 @@ var prefaultProcessor = (schema43, ctx, json2, params) => {
|
|
|
14340
14340
|
};
|
|
14341
14341
|
var catchProcessor = (schema43, ctx, json2, params) => {
|
|
14342
14342
|
const def = schema43._zod.def;
|
|
14343
|
-
|
|
14343
|
+
process(def.innerType, ctx, params);
|
|
14344
14344
|
const seen = ctx.seen.get(schema43);
|
|
14345
14345
|
seen.ref = def.innerType;
|
|
14346
14346
|
let catchValue;
|
|
@@ -14354,32 +14354,32 @@ var catchProcessor = (schema43, ctx, json2, params) => {
|
|
|
14354
14354
|
var pipeProcessor = (schema43, ctx, _json, params) => {
|
|
14355
14355
|
const def = schema43._zod.def;
|
|
14356
14356
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
14357
|
-
|
|
14357
|
+
process(innerType, ctx, params);
|
|
14358
14358
|
const seen = ctx.seen.get(schema43);
|
|
14359
14359
|
seen.ref = innerType;
|
|
14360
14360
|
};
|
|
14361
14361
|
var readonlyProcessor = (schema43, ctx, json2, params) => {
|
|
14362
14362
|
const def = schema43._zod.def;
|
|
14363
|
-
|
|
14363
|
+
process(def.innerType, ctx, params);
|
|
14364
14364
|
const seen = ctx.seen.get(schema43);
|
|
14365
14365
|
seen.ref = def.innerType;
|
|
14366
14366
|
json2.readOnly = true;
|
|
14367
14367
|
};
|
|
14368
14368
|
var promiseProcessor = (schema43, ctx, _json, params) => {
|
|
14369
14369
|
const def = schema43._zod.def;
|
|
14370
|
-
|
|
14370
|
+
process(def.innerType, ctx, params);
|
|
14371
14371
|
const seen = ctx.seen.get(schema43);
|
|
14372
14372
|
seen.ref = def.innerType;
|
|
14373
14373
|
};
|
|
14374
14374
|
var optionalProcessor = (schema43, ctx, _json, params) => {
|
|
14375
14375
|
const def = schema43._zod.def;
|
|
14376
|
-
|
|
14376
|
+
process(def.innerType, ctx, params);
|
|
14377
14377
|
const seen = ctx.seen.get(schema43);
|
|
14378
14378
|
seen.ref = def.innerType;
|
|
14379
14379
|
};
|
|
14380
14380
|
var lazyProcessor = (schema43, ctx, _json, params) => {
|
|
14381
14381
|
const innerType = schema43._zod.innerType;
|
|
14382
|
-
|
|
14382
|
+
process(innerType, ctx, params);
|
|
14383
14383
|
const seen = ctx.seen.get(schema43);
|
|
14384
14384
|
seen.ref = innerType;
|
|
14385
14385
|
};
|
|
@@ -14431,7 +14431,7 @@ function toJSONSchema(input, params) {
|
|
|
14431
14431
|
const defs = {};
|
|
14432
14432
|
for (const entry of registry2._idmap.entries()) {
|
|
14433
14433
|
const [_, schema43] = entry;
|
|
14434
|
-
|
|
14434
|
+
process(schema43, ctx2);
|
|
14435
14435
|
}
|
|
14436
14436
|
const schemas = {};
|
|
14437
14437
|
const external = {
|
|
@@ -14454,7 +14454,7 @@ function toJSONSchema(input, params) {
|
|
|
14454
14454
|
return { schemas };
|
|
14455
14455
|
}
|
|
14456
14456
|
const ctx = initializeContext(__spreadProps(__spreadValues({}, params), { processors: allProcessors }));
|
|
14457
|
-
|
|
14457
|
+
process(input, ctx);
|
|
14458
14458
|
extractDefs(ctx, input);
|
|
14459
14459
|
return finalize(ctx, input);
|
|
14460
14460
|
}
|
|
@@ -14509,7 +14509,7 @@ var JSONSchemaGenerator = class {
|
|
|
14509
14509
|
* This must be called before emit().
|
|
14510
14510
|
*/
|
|
14511
14511
|
process(schema43, _params = { path: [], schemaPath: [] }) {
|
|
14512
|
-
return
|
|
14512
|
+
return process(schema43, this.ctx, _params);
|
|
14513
14513
|
}
|
|
14514
14514
|
/**
|
|
14515
14515
|
* Emit the final JSON Schema after processing.
|
|
@@ -16012,11 +16012,11 @@ function detectVersion(schema43, defaultTarget) {
|
|
|
16012
16012
|
}
|
|
16013
16013
|
return defaultTarget != null ? defaultTarget : "draft-2020-12";
|
|
16014
16014
|
}
|
|
16015
|
-
function resolveRef(
|
|
16016
|
-
if (!
|
|
16015
|
+
function resolveRef(ref, ctx) {
|
|
16016
|
+
if (!ref.startsWith("#")) {
|
|
16017
16017
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
16018
16018
|
}
|
|
16019
|
-
const path =
|
|
16019
|
+
const path = ref.slice(1).split("/").filter(Boolean);
|
|
16020
16020
|
if (path.length === 0) {
|
|
16021
16021
|
return ctx.rootSchema;
|
|
16022
16022
|
}
|
|
@@ -16024,11 +16024,11 @@ function resolveRef(ref2, ctx) {
|
|
|
16024
16024
|
if (path[0] === defsKey) {
|
|
16025
16025
|
const key = path[1];
|
|
16026
16026
|
if (!key || !ctx.defs[key]) {
|
|
16027
|
-
throw new Error(`Reference not found: ${
|
|
16027
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
16028
16028
|
}
|
|
16029
16029
|
return ctx.defs[key];
|
|
16030
16030
|
}
|
|
16031
|
-
throw new Error(`Reference not found: ${
|
|
16031
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
16032
16032
|
}
|
|
16033
16033
|
function convertBaseSchema(schema43, ctx) {
|
|
16034
16034
|
if (schema43.not !== void 0) {
|
|
@@ -16545,10 +16545,6 @@ var SHADCN_CREATE_DEFAULT_CONFIG = {
|
|
|
16545
16545
|
menuAccent: "subtle",
|
|
16546
16546
|
menuColor: "default"
|
|
16547
16547
|
};
|
|
16548
|
-
function shadcnStyleKey(config2) {
|
|
16549
|
-
const prefix = config2.base === "base-ui" ? "base" : "radix";
|
|
16550
|
-
return `${prefix}-${config2.style}`;
|
|
16551
|
-
}
|
|
16552
16548
|
var MuiDensitySchema = external_exports.enum(["comfortable", "standard", "compact"]);
|
|
16553
16549
|
var MuiLibraryConfigSchema = external_exports.object({
|
|
16554
16550
|
theme: external_exports.string().min(1),
|
|
@@ -16672,9 +16668,6 @@ var LEGACY_TO_AXES = {
|
|
|
16672
16668
|
blue: { baseColor: "neutral", theme: "blue" },
|
|
16673
16669
|
violet: { baseColor: "neutral", theme: "violet" }
|
|
16674
16670
|
};
|
|
16675
|
-
function isLegacyShadcnPresetSkinId(skinId) {
|
|
16676
|
-
return isValidPreset(skinId) || skinId in LEGACY_TO_AXES || isShadcnStylePresetSkinId(skinId);
|
|
16677
|
-
}
|
|
16678
16671
|
function migrateLegacySkinId(legacyId) {
|
|
16679
16672
|
const axes = LEGACY_TO_AXES[legacyId];
|
|
16680
16673
|
if (axes) {
|
|
@@ -16745,13 +16738,6 @@ var ACCENT_THEMES = __spreadValues({
|
|
|
16745
16738
|
}, Object.fromEntries(
|
|
16746
16739
|
CHROMATIC_THEME_IDS.map((id) => [id, buildChromaticAccent(id)])
|
|
16747
16740
|
));
|
|
16748
|
-
function isChromaticTheme(theme) {
|
|
16749
|
-
return CHROMATIC_THEME_IDS.includes(theme);
|
|
16750
|
-
}
|
|
16751
|
-
function getAccentThemeTokens(theme) {
|
|
16752
|
-
var _a3;
|
|
16753
|
-
return (_a3 = ACCENT_THEMES[theme]) != null ? _a3 : { light: {}, dark: {} };
|
|
16754
|
-
}
|
|
16755
16741
|
|
|
16756
16742
|
// src/lib/componentLibrary/providers/shadcn/tokens/baseColors.ts
|
|
16757
16743
|
function themeModeToCssVars(mode) {
|
|
@@ -16775,328 +16761,66 @@ var BRIDGED_BASE_COLORS = {
|
|
|
16775
16761
|
mist: fromThemesTheme("mist"),
|
|
16776
16762
|
taupe: fromThemesTheme("taupe")
|
|
16777
16763
|
};
|
|
16778
|
-
function getBaseColorTokens(baseColor) {
|
|
16779
|
-
var _a3;
|
|
16780
|
-
return (_a3 = BRIDGED_BASE_COLORS[baseColor]) != null ? _a3 : BRIDGED_BASE_COLORS.neutral;
|
|
16781
|
-
}
|
|
16782
|
-
|
|
16783
|
-
// src/lib/componentLibrary/providers/shadcn/tokens/chartColors.ts
|
|
16784
|
-
var CHROMATIC_CHART_RAMPS = {
|
|
16785
|
-
amber: [
|
|
16786
|
-
"oklch(0.879 0.169 91.605)",
|
|
16787
|
-
"oklch(0.769 0.188 70.08)",
|
|
16788
|
-
"oklch(0.666 0.179 58.318)",
|
|
16789
|
-
"oklch(0.555 0.163 48.998)",
|
|
16790
|
-
"oklch(0.473 0.137 46.201)"
|
|
16791
|
-
],
|
|
16792
|
-
blue: [
|
|
16793
|
-
"oklch(0.809 0.105 251.813)",
|
|
16794
|
-
"oklch(0.623 0.214 259.815)",
|
|
16795
|
-
"oklch(0.546 0.245 262.881)",
|
|
16796
|
-
"oklch(0.488 0.243 264.376)",
|
|
16797
|
-
"oklch(0.424 0.199 265.638)"
|
|
16798
|
-
],
|
|
16799
|
-
cyan: [
|
|
16800
|
-
"oklch(0.865 0.127 207.078)",
|
|
16801
|
-
"oklch(0.715 0.143 215.221)",
|
|
16802
|
-
"oklch(0.609 0.126 221.723)",
|
|
16803
|
-
"oklch(0.52 0.105 223.128)",
|
|
16804
|
-
"oklch(0.45 0.085 224.283)"
|
|
16805
|
-
],
|
|
16806
|
-
emerald: [
|
|
16807
|
-
"oklch(0.845 0.143 164.978)",
|
|
16808
|
-
"oklch(0.696 0.17 162.48)",
|
|
16809
|
-
"oklch(0.596 0.145 163.225)",
|
|
16810
|
-
"oklch(0.508 0.118 165.612)",
|
|
16811
|
-
"oklch(0.432 0.095 166.913)"
|
|
16812
|
-
],
|
|
16813
|
-
fuchsia: [
|
|
16814
|
-
"oklch(0.833 0.145 321.434)",
|
|
16815
|
-
"oklch(0.667 0.295 322.15)",
|
|
16816
|
-
"oklch(0.591 0.293 322.896)",
|
|
16817
|
-
"oklch(0.518 0.253 323.949)",
|
|
16818
|
-
"oklch(0.452 0.211 324.591)"
|
|
16819
|
-
],
|
|
16820
|
-
green: [
|
|
16821
|
-
"oklch(0.871 0.15 154.449)",
|
|
16822
|
-
"oklch(0.723 0.219 149.579)",
|
|
16823
|
-
"oklch(0.627 0.194 149.214)",
|
|
16824
|
-
"oklch(0.527 0.154 150.069)",
|
|
16825
|
-
"oklch(0.448 0.119 151.328)"
|
|
16826
|
-
],
|
|
16827
|
-
indigo: [
|
|
16828
|
-
"oklch(0.785 0.115 274.713)",
|
|
16829
|
-
"oklch(0.585 0.233 277.117)",
|
|
16830
|
-
"oklch(0.511 0.262 276.966)",
|
|
16831
|
-
"oklch(0.457 0.24 277.023)",
|
|
16832
|
-
"oklch(0.398 0.195 277.366)"
|
|
16833
|
-
],
|
|
16834
|
-
lime: [
|
|
16835
|
-
"oklch(0.897 0.196 126.665)",
|
|
16836
|
-
"oklch(0.768 0.233 130.85)",
|
|
16837
|
-
"oklch(0.648 0.2 131.684)",
|
|
16838
|
-
"oklch(0.532 0.157 131.589)",
|
|
16839
|
-
"oklch(0.453 0.124 130.933)"
|
|
16840
|
-
],
|
|
16841
|
-
orange: [
|
|
16842
|
-
"oklch(0.837 0.128 66.29)",
|
|
16843
|
-
"oklch(0.705 0.213 47.604)",
|
|
16844
|
-
"oklch(0.646 0.222 41.116)",
|
|
16845
|
-
"oklch(0.553 0.195 38.402)",
|
|
16846
|
-
"oklch(0.47 0.157 37.304)"
|
|
16847
|
-
],
|
|
16848
|
-
pink: [
|
|
16849
|
-
"oklch(0.823 0.12 346.018)",
|
|
16850
|
-
"oklch(0.656 0.241 354.308)",
|
|
16851
|
-
"oklch(0.592 0.249 0.584)",
|
|
16852
|
-
"oklch(0.525 0.223 3.958)",
|
|
16853
|
-
"oklch(0.459 0.187 3.815)"
|
|
16854
|
-
],
|
|
16855
|
-
purple: [
|
|
16856
|
-
"oklch(0.827 0.119 306.383)",
|
|
16857
|
-
"oklch(0.627 0.265 303.9)",
|
|
16858
|
-
"oklch(0.558 0.288 302.321)",
|
|
16859
|
-
"oklch(0.496 0.265 301.924)",
|
|
16860
|
-
"oklch(0.438 0.218 303.724)"
|
|
16861
|
-
],
|
|
16862
|
-
red: [
|
|
16863
|
-
"oklch(0.808 0.114 19.571)",
|
|
16864
|
-
"oklch(0.637 0.237 25.331)",
|
|
16865
|
-
"oklch(0.577 0.245 27.325)",
|
|
16866
|
-
"oklch(0.505 0.213 27.518)",
|
|
16867
|
-
"oklch(0.444 0.177 26.899)"
|
|
16868
|
-
],
|
|
16869
|
-
rose: [
|
|
16870
|
-
"oklch(0.81 0.117 11.638)",
|
|
16871
|
-
"oklch(0.645 0.246 16.439)",
|
|
16872
|
-
"oklch(0.586 0.253 17.585)",
|
|
16873
|
-
"oklch(0.514 0.222 16.935)",
|
|
16874
|
-
"oklch(0.455 0.188 13.697)"
|
|
16875
|
-
],
|
|
16876
|
-
sky: [
|
|
16877
|
-
"oklch(0.828 0.111 230.318)",
|
|
16878
|
-
"oklch(0.685 0.169 237.323)",
|
|
16879
|
-
"oklch(0.588 0.158 241.966)",
|
|
16880
|
-
"oklch(0.5 0.134 242.749)",
|
|
16881
|
-
"oklch(0.443 0.11 240.79)"
|
|
16882
|
-
],
|
|
16883
|
-
teal: [
|
|
16884
|
-
"oklch(0.855 0.138 181.071)",
|
|
16885
|
-
"oklch(0.704 0.14 182.503)",
|
|
16886
|
-
"oklch(0.6 0.118 184.704)",
|
|
16887
|
-
"oklch(0.511 0.096 186.391)",
|
|
16888
|
-
"oklch(0.437 0.078 188.216)"
|
|
16889
|
-
],
|
|
16890
|
-
violet: [
|
|
16891
|
-
"oklch(0.811 0.111 293.571)",
|
|
16892
|
-
"oklch(0.606 0.25 292.717)",
|
|
16893
|
-
"oklch(0.541 0.281 293.009)",
|
|
16894
|
-
"oklch(0.491 0.27 292.581)",
|
|
16895
|
-
"oklch(0.432 0.232 292.759)"
|
|
16896
|
-
],
|
|
16897
|
-
yellow: [
|
|
16898
|
-
"oklch(0.905 0.182 98.111)",
|
|
16899
|
-
"oklch(0.795 0.184 86.047)",
|
|
16900
|
-
"oklch(0.681 0.162 75.834)",
|
|
16901
|
-
"oklch(0.554 0.135 66.442)",
|
|
16902
|
-
"oklch(0.476 0.114 61.907)"
|
|
16903
|
-
]
|
|
16904
|
-
};
|
|
16905
|
-
var NEUTRAL_SEEDS = {
|
|
16906
|
-
neutral: { hue: 0, chroma: 0 },
|
|
16907
|
-
gray: { hue: 0, chroma: 0 },
|
|
16908
|
-
zinc: { hue: 286, chroma: 8e-3 },
|
|
16909
|
-
slate: { hue: 240, chroma: 0.024 },
|
|
16910
|
-
stone: { hue: 60, chroma: 0.016 },
|
|
16911
|
-
mauve: { hue: 322, chroma: 0.024 },
|
|
16912
|
-
olive: { hue: 131, chroma: 0.024 },
|
|
16913
|
-
mist: { hue: 237, chroma: 0.024 },
|
|
16914
|
-
taupe: { hue: 70, chroma: 0.024 }
|
|
16915
|
-
};
|
|
16916
|
-
var NEUTRAL_LIGHT_STOPS = [0.62, 0.7, 0.54, 0.8, 0.46];
|
|
16917
|
-
var NEUTRAL_DARK_STOPS = [0.7, 0.62, 0.8, 0.54, 0.46];
|
|
16918
|
-
function round(n, places) {
|
|
16919
|
-
const f = 10 ** places;
|
|
16920
|
-
return Math.round(n * f) / f;
|
|
16921
|
-
}
|
|
16922
|
-
function neutralChartVars(seed, scheme) {
|
|
16923
|
-
const stops = scheme === "light" ? NEUTRAL_LIGHT_STOPS : NEUTRAL_DARK_STOPS;
|
|
16924
|
-
const vars = {};
|
|
16925
|
-
for (let i = 0; i < 5; i += 1) {
|
|
16926
|
-
vars[`--chart-${i + 1}`] = `oklch(${round(stops[i], 3)} ${round(seed.chroma, 3)} ${round(seed.hue, 1)})`;
|
|
16927
|
-
}
|
|
16928
|
-
return vars;
|
|
16929
|
-
}
|
|
16930
|
-
function chartVarsForColor(chartColor, scheme) {
|
|
16931
|
-
var _a3;
|
|
16932
|
-
const chromatic = CHROMATIC_CHART_RAMPS[chartColor];
|
|
16933
|
-
if (chromatic) {
|
|
16934
|
-
const vars = {};
|
|
16935
|
-
for (let i = 0; i < 5; i += 1) {
|
|
16936
|
-
vars[`--chart-${i + 1}`] = chromatic[i];
|
|
16937
|
-
}
|
|
16938
|
-
return vars;
|
|
16939
|
-
}
|
|
16940
|
-
const seed = (_a3 = NEUTRAL_SEEDS[chartColor]) != null ? _a3 : NEUTRAL_SEEDS.neutral;
|
|
16941
|
-
return neutralChartVars(seed, scheme);
|
|
16942
|
-
}
|
|
16943
|
-
|
|
16944
|
-
// src/lib/componentLibrary/providers/shadcn/tokens/radius.ts
|
|
16945
|
-
var RADIUS_VALUES = {
|
|
16946
|
-
none: "0",
|
|
16947
|
-
sm: "0.45rem",
|
|
16948
|
-
md: "0.625rem",
|
|
16949
|
-
lg: "0.875rem",
|
|
16950
|
-
xl: "1rem"
|
|
16951
|
-
};
|
|
16952
|
-
var DEFAULT_RADIUS_CSS = "0.625rem";
|
|
16953
|
-
function resolveRadiusCss(radius, baseRadius = DEFAULT_RADIUS_CSS) {
|
|
16954
|
-
if (radius === "default") {
|
|
16955
|
-
return baseRadius;
|
|
16956
|
-
}
|
|
16957
|
-
return RADIUS_VALUES[radius];
|
|
16958
|
-
}
|
|
16959
|
-
|
|
16960
|
-
// src/lib/componentLibrary/providers/shadcn/tokens/mergeTheme.ts
|
|
16961
|
-
function mergeModeVars(base, accent) {
|
|
16962
|
-
const merged = __spreadValues({}, base);
|
|
16963
|
-
for (const [key, value] of Object.entries(accent)) {
|
|
16964
|
-
if (value !== void 0) {
|
|
16965
|
-
merged[key] = value;
|
|
16966
|
-
}
|
|
16967
|
-
}
|
|
16968
|
-
return merged;
|
|
16969
|
-
}
|
|
16970
|
-
function resolveScaffoldBaseColor(baseColor, theme) {
|
|
16971
|
-
if (isChromaticTheme(theme)) {
|
|
16972
|
-
return "zinc";
|
|
16973
|
-
}
|
|
16974
|
-
return baseColor;
|
|
16975
|
-
}
|
|
16976
|
-
function mergeRegistryTheme(config2) {
|
|
16977
|
-
const scaffoldBase = resolveScaffoldBaseColor(config2.baseColor, config2.theme);
|
|
16978
|
-
const baseTokens = getBaseColorTokens(scaffoldBase);
|
|
16979
|
-
const accentTokens = getAccentThemeTokens(config2.theme);
|
|
16980
|
-
const lightVars = mergeModeVars(
|
|
16981
|
-
baseTokens.light,
|
|
16982
|
-
config2.theme === "neutral" ? {} : accentTokens.light
|
|
16983
|
-
);
|
|
16984
|
-
const darkVars = mergeModeVars(
|
|
16985
|
-
baseTokens.dark,
|
|
16986
|
-
config2.theme === "neutral" ? {} : accentTokens.dark
|
|
16987
|
-
);
|
|
16988
|
-
Object.assign(lightVars, chartVarsForColor(config2.chartColor, "light"));
|
|
16989
|
-
Object.assign(darkVars, chartVarsForColor(config2.chartColor, "dark"));
|
|
16990
|
-
if (config2.menuAccent === "bold") {
|
|
16991
|
-
lightVars["--accent"] = lightVars["--primary"];
|
|
16992
|
-
lightVars["--accent-foreground"] = lightVars["--primary-foreground"];
|
|
16993
|
-
darkVars["--accent"] = darkVars["--primary"];
|
|
16994
|
-
darkVars["--accent-foreground"] = darkVars["--primary-foreground"];
|
|
16995
|
-
}
|
|
16996
|
-
const inverted = config2.menuColor === "inverted" || config2.menuColor === "inverted-translucent";
|
|
16997
|
-
const translucent = config2.menuColor === "default-translucent" || config2.menuColor === "inverted-translucent";
|
|
16998
|
-
for (const vars of [lightVars, darkVars]) {
|
|
16999
|
-
const baseBg = inverted ? vars["--foreground"] : vars["--background"];
|
|
17000
|
-
vars["--navbar-bg"] = translucent ? `color-mix(in oklch, ${baseBg} 80%, transparent)` : baseBg;
|
|
17001
|
-
vars["--navbar-fg"] = inverted ? vars["--background"] : vars["--foreground"];
|
|
17002
|
-
vars["--navbar-backdrop"] = translucent ? "blur(12px)" : "none";
|
|
17003
|
-
}
|
|
17004
|
-
const baseRadius = DEFAULT_RADIUS_CSS;
|
|
17005
|
-
const radius = resolveRadiusCss(config2.radius, baseRadius);
|
|
17006
|
-
return {
|
|
17007
|
-
light: lightVars,
|
|
17008
|
-
dark: darkVars,
|
|
17009
|
-
radius
|
|
17010
|
-
};
|
|
17011
|
-
}
|
|
17012
|
-
|
|
17013
|
-
// src/lib/componentLibrary/providers/shadcn/compile.ts
|
|
17014
|
-
function compileShadcnSkin(config2, libraryConfig) {
|
|
17015
|
-
const merged = mergeRegistryTheme(config2);
|
|
17016
|
-
return {
|
|
17017
|
-
provider: "shadcn",
|
|
17018
|
-
structuralStyleId: shadcnStyleKey(config2),
|
|
17019
|
-
cssVars: {
|
|
17020
|
-
light: __spreadProps(__spreadValues({}, merged.light), {
|
|
17021
|
-
"--radius": merged.radius
|
|
17022
|
-
}),
|
|
17023
|
-
dark: __spreadProps(__spreadValues({}, merged.dark), {
|
|
17024
|
-
"--radius": merged.radius
|
|
17025
|
-
})
|
|
17026
|
-
},
|
|
17027
|
-
libraryConfig
|
|
17028
|
-
};
|
|
17029
|
-
}
|
|
17030
|
-
|
|
17031
|
-
// src/lib/componentLibrary/compile.ts
|
|
17032
|
-
function compileComponentLibraryConfig(config2) {
|
|
17033
|
-
switch (config2.provider) {
|
|
17034
|
-
case "shadcn":
|
|
17035
|
-
return CompiledSkinSchema.parse(compileShadcnSkin(config2.shadcn, config2));
|
|
17036
|
-
case "mui":
|
|
17037
|
-
throw new Error("MUI provider compile not implemented");
|
|
17038
|
-
}
|
|
17039
|
-
}
|
|
17040
16764
|
|
|
17041
16765
|
// src/lib/siteTokens.ts
|
|
17042
16766
|
function expandSiteDs(ds) {
|
|
17043
16767
|
const out = __spreadValues({}, ds);
|
|
17044
|
-
const
|
|
16768
|
+
const set2 = (k, v) => {
|
|
17045
16769
|
if (!out[k]) out[k] = v;
|
|
17046
16770
|
};
|
|
17047
16771
|
if (out["--surface-container-high"]) {
|
|
17048
16772
|
out["--card"] = out["--surface-container-high"];
|
|
17049
16773
|
out["--card-bg"] = out["--surface-container-high"];
|
|
17050
16774
|
} else if (out["--muted"]) {
|
|
17051
|
-
|
|
17052
|
-
|
|
16775
|
+
set2("--card", out["--muted"]);
|
|
16776
|
+
set2("--card-bg", out["--muted"]);
|
|
17053
16777
|
}
|
|
17054
|
-
if (out["--border"])
|
|
17055
|
-
if (out["--foreground"])
|
|
17056
|
-
if (out["--muted-fg"])
|
|
17057
|
-
if (out["--accent-fg"])
|
|
16778
|
+
if (out["--border"]) set2("--card-border", out["--border"]);
|
|
16779
|
+
if (out["--foreground"]) set2("--card-foreground", out["--foreground"]);
|
|
16780
|
+
if (out["--muted-fg"]) set2("--muted-foreground", out["--muted-fg"]);
|
|
16781
|
+
if (out["--accent-fg"]) set2("--accent-foreground", out["--accent-fg"]);
|
|
17058
16782
|
if (out["--font-sans"]) {
|
|
17059
|
-
|
|
17060
|
-
|
|
16783
|
+
set2("--font-heading", out["--font-sans"]);
|
|
16784
|
+
set2("--font-body", out["--font-sans"]);
|
|
17061
16785
|
}
|
|
17062
16786
|
if (out["--surface-container-high"]) {
|
|
17063
|
-
|
|
17064
|
-
|
|
16787
|
+
set2("--card", out["--surface-container-high"]);
|
|
16788
|
+
set2("--card-bg", out["--surface-container-high"]);
|
|
17065
16789
|
}
|
|
17066
16790
|
if (out["--primary"]) {
|
|
17067
|
-
|
|
16791
|
+
set2(
|
|
17068
16792
|
"--primary-ring",
|
|
17069
16793
|
`oklch(from ${out["--primary"]} l c calc(h + 30deg))`
|
|
17070
16794
|
);
|
|
17071
|
-
|
|
16795
|
+
set2(
|
|
17072
16796
|
"--primary-ring-gradient",
|
|
17073
16797
|
"linear-gradient(135deg, var(--primary), var(--primary-ring))"
|
|
17074
16798
|
);
|
|
17075
16799
|
}
|
|
17076
|
-
if (out["--primary"])
|
|
17077
|
-
if (out["--on-primary"])
|
|
17078
|
-
if (out["--primary-foreground"])
|
|
17079
|
-
if (out["--accent-foreground"])
|
|
16800
|
+
if (out["--primary"]) set2("--accent", out["--primary"]);
|
|
16801
|
+
if (out["--on-primary"]) set2("--accent-fg", out["--on-primary"]);
|
|
16802
|
+
if (out["--primary-foreground"]) set2("--accent-fg", out["--primary-foreground"]);
|
|
16803
|
+
if (out["--accent-foreground"]) set2("--accent-fg", out["--accent-foreground"]);
|
|
17080
16804
|
if (out["--accent"]) {
|
|
17081
|
-
|
|
16805
|
+
set2(
|
|
17082
16806
|
"--accent-ring",
|
|
17083
16807
|
`oklch(from ${out["--accent"]} l c calc(h + 30deg))`
|
|
17084
16808
|
);
|
|
17085
|
-
|
|
16809
|
+
set2(
|
|
17086
16810
|
"--accent-ring-gradient",
|
|
17087
16811
|
"linear-gradient(135deg, var(--accent), var(--accent-ring))"
|
|
17088
16812
|
);
|
|
17089
16813
|
}
|
|
17090
16814
|
if (out["--background"]) {
|
|
17091
|
-
|
|
17092
|
-
|
|
17093
|
-
}
|
|
17094
|
-
if (out["--border"])
|
|
17095
|
-
if (out["--background"])
|
|
17096
|
-
if (out["--foreground"])
|
|
17097
|
-
if (out["--muted"])
|
|
17098
|
-
if (out["--foreground"])
|
|
17099
|
-
|
|
16815
|
+
set2("--card", out["--background"]);
|
|
16816
|
+
set2("--card-bg", out["--background"]);
|
|
16817
|
+
}
|
|
16818
|
+
if (out["--border"]) set2("--card-border", out["--border"]);
|
|
16819
|
+
if (out["--background"]) set2("--section-bg", out["--background"]);
|
|
16820
|
+
if (out["--foreground"]) set2("--section-fg", out["--foreground"]);
|
|
16821
|
+
if (out["--muted"]) set2("--footer-bg", out["--muted"]);
|
|
16822
|
+
if (out["--foreground"]) set2("--footer-fg", out["--foreground"]);
|
|
16823
|
+
set2("--color-danger", "#ef4444");
|
|
17100
16824
|
return out;
|
|
17101
16825
|
}
|
|
17102
16826
|
var DEFAULT_SKIN_ID = "zinc";
|
|
@@ -17152,7 +16876,7 @@ var DEFAULT_SKIN_LAYOUT = {
|
|
|
17152
16876
|
var SKIN_LAYOUT_TOKENS = __spreadProps(__spreadValues({
|
|
17153
16877
|
zinc: DEFAULT_SKIN_LAYOUT
|
|
17154
16878
|
}, Object.fromEntries(
|
|
17155
|
-
|
|
16879
|
+
PRESET_SKIN_IDS.filter((id) => id !== "zinc").map((id) => [id, DEFAULT_SKIN_LAYOUT])
|
|
17156
16880
|
)), {
|
|
17157
16881
|
[GOOGIE_CLEAN_SKIN_ID]: {
|
|
17158
16882
|
"--site-max-width": GOOGIE_CLEAN_LAYOUT["--site-max-width"],
|
|
@@ -17180,7 +16904,7 @@ function getSkinLayoutTokens(skinId) {
|
|
|
17180
16904
|
return (_b = SKIN_LAYOUT_TOKENS[resolved]) != null ? _b : SKIN_LAYOUT_TOKENS[DEFAULT_SKIN_ID];
|
|
17181
16905
|
}
|
|
17182
16906
|
var ADAPTIVE_SKINS = [
|
|
17183
|
-
...
|
|
16907
|
+
...PRESET_SKINS,
|
|
17184
16908
|
{
|
|
17185
16909
|
id: GOOGIE_CLEAN_SKIN_ID,
|
|
17186
16910
|
name: "Googie Clean",
|
|
@@ -17255,6 +16979,11 @@ function getAdaptiveSkin(id) {
|
|
|
17255
16979
|
const resolved = (_a3 = LEGACY_SKIN_IDS[id]) != null ? _a3 : id;
|
|
17256
16980
|
return (_b = ADAPTIVE_SKINS.find((s) => s.id === resolved)) != null ? _b : ADAPTIVE_SKINS[0];
|
|
17257
16981
|
}
|
|
16982
|
+
function isRegisteredSkinId(skinId) {
|
|
16983
|
+
var _a3;
|
|
16984
|
+
const resolved = (_a3 = LEGACY_SKIN_IDS[skinId]) != null ? _a3 : skinId;
|
|
16985
|
+
return ADAPTIVE_SKINS.some((s) => s.id === resolved);
|
|
16986
|
+
}
|
|
17258
16987
|
function modeToCoreVars(mode) {
|
|
17259
16988
|
return {
|
|
17260
16989
|
"--background": mode.background,
|
|
@@ -17794,9 +17523,9 @@ var BUILTIN_SKINS = ADAPTIVE_SKINS.map((skin) => ({
|
|
|
17794
17523
|
base: skin.base,
|
|
17795
17524
|
ds: getSkinStorageDs(skin.id)
|
|
17796
17525
|
}));
|
|
17797
|
-
var PHASE1_SKIN_IDS = [...
|
|
17798
|
-
var INTAKE_SCRATCH_SKIN_IDS = [...
|
|
17799
|
-
var BUILDER_SKINS =
|
|
17526
|
+
var PHASE1_SKIN_IDS = [...PRESET_SKIN_IDS];
|
|
17527
|
+
var INTAKE_SCRATCH_SKIN_IDS = [...PRESET_SKIN_IDS];
|
|
17528
|
+
var BUILDER_SKINS = PRESET_SKIN_IDS.map((id) => {
|
|
17800
17529
|
const row = BUILTIN_SKINS.find((s) => s.id === id);
|
|
17801
17530
|
if (!row) throw new Error(`Missing shadcn preset skin: ${id}`);
|
|
17802
17531
|
return __spreadProps(__spreadValues({}, row), { libraryConfig: migrateLegacySkinId(id) });
|
|
@@ -18428,71 +18157,6 @@ function SiteSurface({
|
|
|
18428
18157
|
] });
|
|
18429
18158
|
}
|
|
18430
18159
|
|
|
18431
|
-
// src/lib/componentLibrary/shuffleLibraryConfig.ts
|
|
18432
|
-
var BASE_COLOR_NAMES = ShadcnBaseColorSchema.options;
|
|
18433
|
-
|
|
18434
|
-
// src/lib/designSystems.ts
|
|
18435
|
-
import { ref, get, set as set2, remove, push } from "firebase/database";
|
|
18436
|
-
|
|
18437
|
-
// src/lib/firebase.ts
|
|
18438
|
-
import { initializeApp, getApps } from "firebase/app";
|
|
18439
|
-
import { getDatabase, connectDatabaseEmulator } from "firebase/database";
|
|
18440
|
-
import { getAuth, GoogleAuthProvider } from "firebase/auth";
|
|
18441
|
-
import { getStorage } from "firebase/storage";
|
|
18442
|
-
var firebaseConfig = {
|
|
18443
|
-
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
|
|
18444
|
-
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
|
|
18445
|
-
databaseURL: process.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL,
|
|
18446
|
-
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
|
|
18447
|
-
storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
|
|
18448
|
-
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
|
|
18449
|
-
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID
|
|
18450
|
-
};
|
|
18451
|
-
var isFirebaseConfigured = firebaseConfig.apiKey && firebaseConfig.projectId && firebaseConfig.databaseURL;
|
|
18452
|
-
var database = null;
|
|
18453
|
-
var auth = null;
|
|
18454
|
-
var storage = null;
|
|
18455
|
-
var app = null;
|
|
18456
|
-
if (isFirebaseConfigured) {
|
|
18457
|
-
try {
|
|
18458
|
-
app = getApps().length === 0 ? initializeApp(firebaseConfig) : getApps()[0];
|
|
18459
|
-
database = getDatabase(app);
|
|
18460
|
-
auth = getAuth(app);
|
|
18461
|
-
storage = getStorage(app);
|
|
18462
|
-
const dbEmulatorHost = process.env.NEXT_PUBLIC_FIREBASE_DATABASE_EMULATOR_HOST;
|
|
18463
|
-
if (dbEmulatorHost && typeof window !== "undefined") {
|
|
18464
|
-
const [host, portStr] = dbEmulatorHost.split(":");
|
|
18465
|
-
connectDatabaseEmulator(database, host, parseInt(portStr, 10));
|
|
18466
|
-
}
|
|
18467
|
-
} catch (error48) {
|
|
18468
|
-
console.warn("Firebase initialization failed:", error48);
|
|
18469
|
-
}
|
|
18470
|
-
}
|
|
18471
|
-
var googleProvider = new GoogleAuthProvider();
|
|
18472
|
-
if (isFirebaseConfigured) {
|
|
18473
|
-
googleProvider.setCustomParameters({
|
|
18474
|
-
prompt: "select_account"
|
|
18475
|
-
});
|
|
18476
|
-
}
|
|
18477
|
-
if (typeof window !== "undefined") {
|
|
18478
|
-
const originalWarn = console.warn;
|
|
18479
|
-
console.warn = (...args) => {
|
|
18480
|
-
if (String(args[0]).includes("Firebase")) {
|
|
18481
|
-
return;
|
|
18482
|
-
}
|
|
18483
|
-
originalWarn(...args);
|
|
18484
|
-
};
|
|
18485
|
-
}
|
|
18486
|
-
|
|
18487
|
-
// src/lib/componentLibrary/resolveDesignSystemSkin.ts
|
|
18488
|
-
function compiledSkinFromSiteSkinId(skinId) {
|
|
18489
|
-
return compileComponentLibraryConfig(migrateLegacySkinId(skinId));
|
|
18490
|
-
}
|
|
18491
|
-
function compiledSkinFromLegacyPresetSkinId(skinId) {
|
|
18492
|
-
if (!isLegacyShadcnPresetSkinId(skinId)) return void 0;
|
|
18493
|
-
return compiledSkinFromSiteSkinId(skinId);
|
|
18494
|
-
}
|
|
18495
|
-
|
|
18496
18160
|
// src/components/site/SiteButton.tsx
|
|
18497
18161
|
import {
|
|
18498
18162
|
forwardRef
|
|
@@ -18502,7 +18166,7 @@ function variantClass(variant) {
|
|
|
18502
18166
|
return variant === "primary" ? "site-btn-primary" : "site-btn-secondary";
|
|
18503
18167
|
}
|
|
18504
18168
|
var SiteButton = forwardRef(
|
|
18505
|
-
function SiteButton2(_a3,
|
|
18169
|
+
function SiteButton2(_a3, ref) {
|
|
18506
18170
|
var _b = _a3, { variant = "primary", href, className, children } = _b, rest = __objRest(_b, ["variant", "href", "className", "children"]);
|
|
18507
18171
|
var _a4;
|
|
18508
18172
|
const { buttonRecipe } = useSiteStructural();
|
|
@@ -18514,7 +18178,7 @@ var SiteButton = forwardRef(
|
|
|
18514
18178
|
return /* @__PURE__ */ jsx4(
|
|
18515
18179
|
"a",
|
|
18516
18180
|
__spreadProps(__spreadValues({
|
|
18517
|
-
ref
|
|
18181
|
+
ref,
|
|
18518
18182
|
href,
|
|
18519
18183
|
className: classes,
|
|
18520
18184
|
"data-density": density
|
|
@@ -18527,7 +18191,7 @@ var SiteButton = forwardRef(
|
|
|
18527
18191
|
return /* @__PURE__ */ jsx4(
|
|
18528
18192
|
"button",
|
|
18529
18193
|
__spreadProps(__spreadValues({
|
|
18530
|
-
ref
|
|
18194
|
+
ref,
|
|
18531
18195
|
type: (_a4 = buttonProps.type) != null ? _a4 : "button",
|
|
18532
18196
|
className: classes,
|
|
18533
18197
|
"data-density": density
|
|
@@ -24331,13 +23995,13 @@ function NumberTicker(_a3) {
|
|
|
24331
23995
|
"className",
|
|
24332
23996
|
"decimalPlaces"
|
|
24333
23997
|
]);
|
|
24334
|
-
const
|
|
23998
|
+
const ref = useRef2(null);
|
|
24335
23999
|
const motionValue = useMotionValue(direction === "down" ? value : startValue);
|
|
24336
24000
|
const springValue = useSpring(motionValue, {
|
|
24337
24001
|
damping: 60,
|
|
24338
24002
|
stiffness: 100
|
|
24339
24003
|
});
|
|
24340
|
-
const isInView = useInView(
|
|
24004
|
+
const isInView = useInView(ref, { once: true, margin: "0px" });
|
|
24341
24005
|
useEffect3(() => {
|
|
24342
24006
|
let timer = null;
|
|
24343
24007
|
if (isInView) {
|
|
@@ -24353,8 +24017,8 @@ function NumberTicker(_a3) {
|
|
|
24353
24017
|
}, [motionValue, isInView, delay, value, direction, startValue]);
|
|
24354
24018
|
useEffect3(
|
|
24355
24019
|
() => springValue.on("change", (latest) => {
|
|
24356
|
-
if (
|
|
24357
|
-
|
|
24020
|
+
if (ref.current) {
|
|
24021
|
+
ref.current.textContent = Intl.NumberFormat("en-US", {
|
|
24358
24022
|
minimumFractionDigits: decimalPlaces,
|
|
24359
24023
|
maximumFractionDigits: decimalPlaces
|
|
24360
24024
|
}).format(Number(latest.toFixed(decimalPlaces)));
|
|
@@ -24365,7 +24029,7 @@ function NumberTicker(_a3) {
|
|
|
24365
24029
|
return /* @__PURE__ */ jsx58(
|
|
24366
24030
|
"span",
|
|
24367
24031
|
__spreadProps(__spreadValues({
|
|
24368
|
-
ref
|
|
24032
|
+
ref,
|
|
24369
24033
|
className: cn(
|
|
24370
24034
|
"inline-block tracking-wider text-black tabular-nums dark:text-white",
|
|
24371
24035
|
className
|
|
@@ -25286,12 +24950,11 @@ function resolveInstanceCopy(siteCopy, instanceId, sectionId, skinId = DEFAULT_S
|
|
|
25286
24950
|
|
|
25287
24951
|
// src/lib/render/SiteRenderer.tsx
|
|
25288
24952
|
import { Fragment as Fragment9, jsx as jsx68 } from "react/jsx-runtime";
|
|
25289
|
-
function SiteRenderer({ site, registry: registry2, scope }) {
|
|
24953
|
+
function SiteRenderer({ site, registry: registry2, scope, compiledSkin }) {
|
|
25290
24954
|
var _a3;
|
|
25291
24955
|
const skinId = resolveSkinId(site);
|
|
25292
24956
|
const surfaceScope = scope != null ? scope : site.slug;
|
|
25293
24957
|
const dsOverrides = getSkinOverrides(skinId, (_a3 = site.ds) != null ? _a3 : {});
|
|
25294
|
-
const compiledSkin = compiledSkinFromLegacyPresetSkinId(skinId);
|
|
25295
24958
|
function renderNode(inst) {
|
|
25296
24959
|
if (inst.hidden) return null;
|
|
25297
24960
|
const Component43 = registry2[inst.id];
|
|
@@ -25327,13 +24990,17 @@ function SiteRenderer({ site, registry: registry2, scope }) {
|
|
|
25327
24990
|
// src/lib/render/renderSiteToHtml.tsx
|
|
25328
24991
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
25329
24992
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
25330
|
-
function renderSiteToHtml(site, registry2, scope) {
|
|
24993
|
+
function renderSiteToHtml(site, registry2, scope, compiledSkin) {
|
|
25331
24994
|
return renderToStaticMarkup(
|
|
25332
|
-
/* @__PURE__ */ jsx69(SiteRenderer, { site, registry: registry2, scope })
|
|
24995
|
+
/* @__PURE__ */ jsx69(SiteRenderer, { site, registry: registry2, scope, compiledSkin })
|
|
25333
24996
|
);
|
|
25334
24997
|
}
|
|
25335
24998
|
export {
|
|
24999
|
+
PHASE1_SKIN_IDS as PRESET_SKIN_IDS,
|
|
25336
25000
|
SiteRenderer,
|
|
25337
|
-
|
|
25001
|
+
getAdaptiveSkin,
|
|
25002
|
+
isRegisteredSkinId,
|
|
25003
|
+
renderSiteToHtml,
|
|
25004
|
+
resolveSkinId
|
|
25338
25005
|
};
|
|
25339
25006
|
//# sourceMappingURL=index.mjs.map
|