@selfhelp/shared 1.8.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/dist/{common-B96dASgu.d.mts → common-CJSHQL1E.d.mts} +13 -1
- package/dist/{common-B96dASgu.d.ts → common-CJSHQL1E.d.ts} +13 -1
- package/dist/index.d.mts +136 -44
- package/dist/index.d.ts +136 -44
- package/dist/index.js +395 -8
- package/dist/index.mjs +371 -8
- package/dist/plugin-sdk/index.d.mts +2 -2
- package/dist/plugin-sdk/index.d.ts +2 -2
- package/dist/plugin-sdk/index.js +10 -1
- package/dist/plugin-sdk/index.mjs +10 -1
- package/dist/registry/index.d.mts +42 -4
- package/dist/registry/index.d.ts +42 -4
- package/dist/registry/index.js +56 -3
- package/dist/registry/index.mjs +48 -2
- package/dist/{styles.registry-ClluRYkN.d.ts → styles.registry-BV1iF7k-.d.ts} +678 -461
- package/dist/{styles.registry-nl8uzvMN.d.mts → styles.registry-DkoT-FmN.d.mts} +678 -461
- package/dist/theme/index.d.mts +225 -4
- package/dist/theme/index.d.ts +225 -4
- package/dist/theme/index.js +343 -9
- package/dist/theme/index.mjs +325 -8
- package/dist/theme/tailwind.d.mts +2 -2
- package/dist/theme/tailwind.d.ts +2 -2
- package/package.json +1 -1
- package/src/registry/__tests__/platform.test.ts +187 -0
- package/src/registry/index.ts +73 -0
- package/src/registry/styles.registry.ts +60 -0
- package/src/theme/__tests__/mantineVariant.test.ts +87 -0
- package/src/theme/__tests__/semantic.test.ts +231 -0
- package/src/theme/index.ts +2 -0
- package/src/theme/mantineVariant.ts +145 -0
- package/src/theme/semantic.ts +472 -0
- package/src/theme/tailwind.ts +2 -2
- package/src/theme/tokens.ts +2 -2
- package/src/types/__tests__/mobile-adapters.test.ts +80 -0
- package/src/types/index.ts +1 -0
- package/src/types/mantine/common.ts +13 -0
- package/src/types/mobile-adapters.ts +144 -0
- package/src/types/styles/auth.ts +11 -11
- package/src/types/styles/base.ts +4 -4
- package/src/types/styles/composite.ts +59 -45
- package/src/types/styles/error.ts +24 -13
- package/src/types/styles/forms.ts +184 -184
- package/src/types/styles/interactive.ts +81 -76
- package/src/types/styles/layout.ts +103 -85
- package/src/types/styles/media.ts +20 -20
- package/src/types/styles/typography.ts +39 -39
- package/src/types/styles/unknown.ts +20 -2
- package/src/utils/spacing.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -164,7 +164,16 @@ var BASE_STYLE_REGISTRY = {
|
|
|
164
164
|
"entry-list": { description: "Data-driven list of entries (form-log table)", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
165
165
|
"entry-record": { description: "Single-record container", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
166
166
|
"entry-record-delete": { description: "Inline delete confirmation for an entry", category: "composite", frontendOnly: true, canHaveChildren: false },
|
|
167
|
-
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true }
|
|
167
|
+
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
168
|
+
"timeline-item": { description: "A single entry inside a timeline (child-only)", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
169
|
+
// ===== system / data / reference (established backend catalog) =====
|
|
170
|
+
"no-access": { description: "Access-denied surface shown when the user lacks page access", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
171
|
+
missing: { description: 'Generic "content missing" system surface', category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
172
|
+
"not-found": { description: "Page-not-found system surface", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
173
|
+
version: { description: "Build/version diagnostic surface", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
174
|
+
"ref-container": { description: "Renders content referenced from another section", category: "layout", frontendOnly: true, canHaveChildren: true },
|
|
175
|
+
"data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout", frontendOnly: true, canHaveChildren: true },
|
|
176
|
+
"show-user-input": { description: "Displays previously submitted user input as a list/card view", category: "forms", frontendOnly: true, canHaveChildren: false }
|
|
168
177
|
};
|
|
169
178
|
var STYLE_REGISTRY = BASE_STYLE_REGISTRY;
|
|
170
179
|
var PLUGIN_STYLE_REGISTRY = {};
|
|
@@ -247,6 +256,36 @@ function getStylePluginId(name) {
|
|
|
247
256
|
const plugin = getPluginStyleRegistry()[name];
|
|
248
257
|
return plugin?.pluginId;
|
|
249
258
|
}
|
|
259
|
+
var DEFAULT_PLATFORMS = ["web", "mobile"];
|
|
260
|
+
function getStylePlatforms(name) {
|
|
261
|
+
const entry = getRegistryEntryAny(name);
|
|
262
|
+
return entry?.platforms ?? DEFAULT_PLATFORMS;
|
|
263
|
+
}
|
|
264
|
+
function isStyleSupportedOnPlatform(name, platform) {
|
|
265
|
+
return getStylePlatforms(name).includes(platform);
|
|
266
|
+
}
|
|
267
|
+
function stylePlatformToSet(platform) {
|
|
268
|
+
return platform === "both" ? DEFAULT_PLATFORMS : [platform];
|
|
269
|
+
}
|
|
270
|
+
function setToStylePlatform(set) {
|
|
271
|
+
const web = set.includes("web");
|
|
272
|
+
const mobile = set.includes("mobile");
|
|
273
|
+
if (web && mobile) return "both";
|
|
274
|
+
return mobile ? "mobile" : "web";
|
|
275
|
+
}
|
|
276
|
+
function isStyleAllowedOnPage(name, pagePlatform) {
|
|
277
|
+
if (pagePlatform === "both") return true;
|
|
278
|
+
return isStyleSupportedOnPlatform(name, pagePlatform);
|
|
279
|
+
}
|
|
280
|
+
function getStylePlacement(name) {
|
|
281
|
+
return getRegistryEntryAny(name)?.placement ?? "any";
|
|
282
|
+
}
|
|
283
|
+
function isStylePlacementAllowed(name, isRoot) {
|
|
284
|
+
const placement = getStylePlacement(name);
|
|
285
|
+
if (placement === "rootOnly") return isRoot;
|
|
286
|
+
if (placement === "containerOnly") return !isRoot;
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
250
289
|
|
|
251
290
|
// src/api/endpoints.ts
|
|
252
291
|
var API_VERSION_PREFIX = "/cms-api/v1";
|
|
@@ -385,23 +424,23 @@ function radiusToPx(token) {
|
|
|
385
424
|
function colorToHex(name, shade = 6) {
|
|
386
425
|
if (!name) return void 0;
|
|
387
426
|
if (name.startsWith("#") || name.startsWith("rgb") || name.startsWith("hsl")) return name;
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
390
|
-
return
|
|
427
|
+
const scale2 = COLOR_SCALES[name];
|
|
428
|
+
if (!scale2) return name;
|
|
429
|
+
return scale2[Math.max(0, Math.min(9, shade))];
|
|
391
430
|
}
|
|
392
431
|
|
|
393
432
|
// src/theme/tailwind.ts
|
|
394
433
|
var px = (n) => n === void 0 ? "0px" : `${n}px`;
|
|
395
|
-
var colorScaleToTailwind = (
|
|
434
|
+
var colorScaleToTailwind = (scale2) => {
|
|
396
435
|
const out = {};
|
|
397
|
-
|
|
436
|
+
scale2.forEach((value, idx) => {
|
|
398
437
|
out[String(idx)] = value;
|
|
399
438
|
});
|
|
400
439
|
return out;
|
|
401
440
|
};
|
|
402
441
|
var colors = {};
|
|
403
|
-
for (const [name,
|
|
404
|
-
colors[name] = colorScaleToTailwind(
|
|
442
|
+
for (const [name, scale2] of Object.entries(COLOR_SCALES)) {
|
|
443
|
+
colors[name] = colorScaleToTailwind(scale2);
|
|
405
444
|
}
|
|
406
445
|
var spacing = {
|
|
407
446
|
none: px(SPACING_PX.none),
|
|
@@ -437,6 +476,306 @@ var sharedTailwindPreset = {
|
|
|
437
476
|
}
|
|
438
477
|
};
|
|
439
478
|
|
|
479
|
+
// src/theme/semantic.ts
|
|
480
|
+
var FULL_RADIUS_PX = 9999;
|
|
481
|
+
var SEMANTIC_SIZES = ["sm", "md", "lg"];
|
|
482
|
+
var SEMANTIC_RADII = ["none", "sm", "md", "lg", "full"];
|
|
483
|
+
var SEMANTIC_INTENTS = [
|
|
484
|
+
"primary",
|
|
485
|
+
"secondary",
|
|
486
|
+
"success",
|
|
487
|
+
"warning",
|
|
488
|
+
"danger",
|
|
489
|
+
"neutral"
|
|
490
|
+
];
|
|
491
|
+
function mapSizeToMantine(size) {
|
|
492
|
+
return size;
|
|
493
|
+
}
|
|
494
|
+
function mapSizeToHeroUi(size) {
|
|
495
|
+
if (!size) return void 0;
|
|
496
|
+
switch (size) {
|
|
497
|
+
case "sm":
|
|
498
|
+
return "sm";
|
|
499
|
+
case "md":
|
|
500
|
+
return "md";
|
|
501
|
+
case "lg":
|
|
502
|
+
return "lg";
|
|
503
|
+
default:
|
|
504
|
+
return void 0;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
function mapRadiusToPx(radius) {
|
|
508
|
+
if (!radius) return void 0;
|
|
509
|
+
switch (radius) {
|
|
510
|
+
case "none":
|
|
511
|
+
return 0;
|
|
512
|
+
case "full":
|
|
513
|
+
return FULL_RADIUS_PX;
|
|
514
|
+
case "sm":
|
|
515
|
+
return RADIUS_PX.sm;
|
|
516
|
+
case "md":
|
|
517
|
+
return RADIUS_PX.md;
|
|
518
|
+
case "lg":
|
|
519
|
+
return RADIUS_PX.lg;
|
|
520
|
+
default:
|
|
521
|
+
return void 0;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
function mapRadiusToMantine(radius) {
|
|
525
|
+
if (!radius) return void 0;
|
|
526
|
+
switch (radius) {
|
|
527
|
+
case "none":
|
|
528
|
+
return 0;
|
|
529
|
+
case "full":
|
|
530
|
+
return FULL_RADIUS_PX;
|
|
531
|
+
case "sm":
|
|
532
|
+
return "sm";
|
|
533
|
+
case "md":
|
|
534
|
+
return "md";
|
|
535
|
+
case "lg":
|
|
536
|
+
return "lg";
|
|
537
|
+
default:
|
|
538
|
+
return void 0;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
function mapSpacingToPx(spacing2) {
|
|
542
|
+
if (!spacing2) return void 0;
|
|
543
|
+
if (spacing2 === "none") return 0;
|
|
544
|
+
return SPACING_PX[spacing2];
|
|
545
|
+
}
|
|
546
|
+
function mapIntentToMantine(intent) {
|
|
547
|
+
if (!intent) return void 0;
|
|
548
|
+
switch (intent) {
|
|
549
|
+
case "primary":
|
|
550
|
+
return { color: "blue", variant: "filled" };
|
|
551
|
+
case "secondary":
|
|
552
|
+
return { color: "gray", variant: "light" };
|
|
553
|
+
case "success":
|
|
554
|
+
return { color: "green", variant: "filled" };
|
|
555
|
+
case "warning":
|
|
556
|
+
return { color: "yellow", variant: "filled" };
|
|
557
|
+
case "danger":
|
|
558
|
+
return { color: "red", variant: "filled" };
|
|
559
|
+
case "neutral":
|
|
560
|
+
return { color: "gray", variant: "default" };
|
|
561
|
+
default:
|
|
562
|
+
return void 0;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function mapIntentToHeroUiButtonVariant(intent) {
|
|
566
|
+
if (!intent) return void 0;
|
|
567
|
+
switch (intent) {
|
|
568
|
+
case "primary":
|
|
569
|
+
return "primary";
|
|
570
|
+
case "secondary":
|
|
571
|
+
return "secondary";
|
|
572
|
+
case "success":
|
|
573
|
+
return "primary";
|
|
574
|
+
case "warning":
|
|
575
|
+
return "primary";
|
|
576
|
+
case "danger":
|
|
577
|
+
return "danger";
|
|
578
|
+
case "neutral":
|
|
579
|
+
return "secondary";
|
|
580
|
+
default:
|
|
581
|
+
return void 0;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function mapIntentToHeroUiColor(intent) {
|
|
585
|
+
if (!intent) return void 0;
|
|
586
|
+
switch (intent) {
|
|
587
|
+
case "primary":
|
|
588
|
+
return "accent";
|
|
589
|
+
case "secondary":
|
|
590
|
+
return "default";
|
|
591
|
+
case "success":
|
|
592
|
+
return "success";
|
|
593
|
+
case "warning":
|
|
594
|
+
return "warning";
|
|
595
|
+
case "danger":
|
|
596
|
+
return "danger";
|
|
597
|
+
case "neutral":
|
|
598
|
+
return "default";
|
|
599
|
+
default:
|
|
600
|
+
return void 0;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function hasState(states, state) {
|
|
604
|
+
return !!states && states.includes(state);
|
|
605
|
+
}
|
|
606
|
+
function readString(value) {
|
|
607
|
+
if (typeof value === "string" && value !== "") return value;
|
|
608
|
+
return void 0;
|
|
609
|
+
}
|
|
610
|
+
function readBool(value) {
|
|
611
|
+
if (typeof value === "boolean") return value;
|
|
612
|
+
if (value === "1" || value === 1) return true;
|
|
613
|
+
if (value === "0" || value === 0) return false;
|
|
614
|
+
return void 0;
|
|
615
|
+
}
|
|
616
|
+
function resolveSharedStyleProps(fields) {
|
|
617
|
+
const resolved = {};
|
|
618
|
+
const size = readString(fields.shared_size);
|
|
619
|
+
if (size !== void 0 && SEMANTIC_SIZES.includes(size)) {
|
|
620
|
+
resolved.size = size;
|
|
621
|
+
}
|
|
622
|
+
const radius = readString(fields.shared_radius);
|
|
623
|
+
if (radius !== void 0 && SEMANTIC_RADII.includes(radius)) {
|
|
624
|
+
resolved.radius = radius;
|
|
625
|
+
}
|
|
626
|
+
const intent = readString(fields.shared_intent);
|
|
627
|
+
if (intent !== void 0 && SEMANTIC_INTENTS.includes(intent)) {
|
|
628
|
+
resolved.intent = intent;
|
|
629
|
+
}
|
|
630
|
+
const fullWidth = readBool(fields.shared_full_width);
|
|
631
|
+
if (fullWidth !== void 0) {
|
|
632
|
+
resolved.fullWidth = fullWidth;
|
|
633
|
+
}
|
|
634
|
+
return resolved;
|
|
635
|
+
}
|
|
636
|
+
function toMantineSemanticProps(props) {
|
|
637
|
+
const intent = mapIntentToMantine(props.intent);
|
|
638
|
+
const spacing2 = props.spacing && props.spacing !== "none" ? props.spacing : void 0;
|
|
639
|
+
return {
|
|
640
|
+
size: mapSizeToMantine(props.size),
|
|
641
|
+
color: intent?.color,
|
|
642
|
+
variant: intent?.variant,
|
|
643
|
+
radius: mapRadiusToMantine(props.radius),
|
|
644
|
+
spacing: spacing2,
|
|
645
|
+
disabled: hasState(props.states, "disabled") || void 0,
|
|
646
|
+
loading: hasState(props.states, "loading") || void 0,
|
|
647
|
+
error: hasState(props.states, "invalid") || void 0,
|
|
648
|
+
required: hasState(props.states, "required") || void 0,
|
|
649
|
+
fullWidth: props.fullWidth || void 0
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
function toHeroUiSemanticProps(props) {
|
|
653
|
+
return {
|
|
654
|
+
size: mapSizeToHeroUi(props.size),
|
|
655
|
+
buttonVariant: mapIntentToHeroUiButtonVariant(props.intent),
|
|
656
|
+
color: mapIntentToHeroUiColor(props.intent),
|
|
657
|
+
radiusPx: mapRadiusToPx(props.radius),
|
|
658
|
+
spacingPx: mapSpacingToPx(props.spacing),
|
|
659
|
+
isDisabled: hasState(props.states, "disabled") || void 0,
|
|
660
|
+
isLoading: hasState(props.states, "loading") || void 0,
|
|
661
|
+
isInvalid: hasState(props.states, "invalid") || void 0,
|
|
662
|
+
isRequired: hasState(props.states, "required") || void 0,
|
|
663
|
+
fullWidth: props.fullWidth || void 0
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
function toReactNativeSemanticStyle(props, theme) {
|
|
667
|
+
const style = {};
|
|
668
|
+
if (props.radius !== void 0) {
|
|
669
|
+
const borderRadius2 = resolveRadiusPx(props.radius, theme);
|
|
670
|
+
if (borderRadius2 !== void 0) style.borderRadius = borderRadius2;
|
|
671
|
+
}
|
|
672
|
+
if (props.spacing !== void 0) {
|
|
673
|
+
const padding = resolveSpacingPx(props.spacing, theme);
|
|
674
|
+
if (padding !== void 0) style.padding = padding;
|
|
675
|
+
}
|
|
676
|
+
if (props.fullWidth) {
|
|
677
|
+
style.alignSelf = "stretch";
|
|
678
|
+
style.width = "100%";
|
|
679
|
+
}
|
|
680
|
+
return style;
|
|
681
|
+
}
|
|
682
|
+
function resolveRadiusPx(radius, theme) {
|
|
683
|
+
if (radius === "none") return 0;
|
|
684
|
+
if (radius === "full") return FULL_RADIUS_PX;
|
|
685
|
+
return theme?.radiusPx?.[radius] ?? mapRadiusToPx(radius);
|
|
686
|
+
}
|
|
687
|
+
function resolveSpacingPx(spacing2, theme) {
|
|
688
|
+
if (spacing2 === "none") return 0;
|
|
689
|
+
return theme?.spacingPx?.[spacing2] ?? mapSpacingToPx(spacing2);
|
|
690
|
+
}
|
|
691
|
+
function resolveSharedStyle(props) {
|
|
692
|
+
return {
|
|
693
|
+
web: toMantineSemanticProps(props),
|
|
694
|
+
mobile: toHeroUiSemanticProps(props)
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
var resolveSharedStyleForWeb = toMantineSemanticProps;
|
|
698
|
+
var resolveSharedStyleForMobile = toHeroUiSemanticProps;
|
|
699
|
+
|
|
700
|
+
// src/theme/mantineVariant.ts
|
|
701
|
+
var TRANSPARENT = "transparent";
|
|
702
|
+
function scale(color) {
|
|
703
|
+
if (!color) return COLOR_SCALES.blue;
|
|
704
|
+
return COLOR_SCALES[color] ?? COLOR_SCALES.blue;
|
|
705
|
+
}
|
|
706
|
+
function resolveMantineVariant(variant, color) {
|
|
707
|
+
const palette = scale(color);
|
|
708
|
+
const accent = COLOR_PALETTE[color] ?? palette[6] ?? "#228be6";
|
|
709
|
+
const v = variant ?? "filled";
|
|
710
|
+
switch (v) {
|
|
711
|
+
case "light":
|
|
712
|
+
return {
|
|
713
|
+
background: palette[0],
|
|
714
|
+
foreground: palette[8],
|
|
715
|
+
border: TRANSPARENT,
|
|
716
|
+
borderWidth: 0,
|
|
717
|
+
pressedBackground: palette[1],
|
|
718
|
+
accent
|
|
719
|
+
};
|
|
720
|
+
case "outline":
|
|
721
|
+
return {
|
|
722
|
+
background: TRANSPARENT,
|
|
723
|
+
foreground: palette[7],
|
|
724
|
+
border: palette[6],
|
|
725
|
+
borderWidth: 1,
|
|
726
|
+
pressedBackground: palette[0],
|
|
727
|
+
accent
|
|
728
|
+
};
|
|
729
|
+
case "default":
|
|
730
|
+
return {
|
|
731
|
+
background: "#ffffff",
|
|
732
|
+
foreground: "#212529",
|
|
733
|
+
border: "#dee2e6",
|
|
734
|
+
borderWidth: 1,
|
|
735
|
+
pressedBackground: "#f1f3f5",
|
|
736
|
+
accent
|
|
737
|
+
};
|
|
738
|
+
case "subtle":
|
|
739
|
+
return {
|
|
740
|
+
background: TRANSPARENT,
|
|
741
|
+
foreground: palette[7],
|
|
742
|
+
border: TRANSPARENT,
|
|
743
|
+
borderWidth: 0,
|
|
744
|
+
pressedBackground: palette[0],
|
|
745
|
+
accent
|
|
746
|
+
};
|
|
747
|
+
case "transparent":
|
|
748
|
+
return {
|
|
749
|
+
background: TRANSPARENT,
|
|
750
|
+
foreground: palette[7],
|
|
751
|
+
border: TRANSPARENT,
|
|
752
|
+
borderWidth: 0,
|
|
753
|
+
pressedBackground: TRANSPARENT,
|
|
754
|
+
accent
|
|
755
|
+
};
|
|
756
|
+
case "dot":
|
|
757
|
+
return {
|
|
758
|
+
background: TRANSPARENT,
|
|
759
|
+
foreground: palette[7],
|
|
760
|
+
border: "#dee2e6",
|
|
761
|
+
borderWidth: 1,
|
|
762
|
+
pressedBackground: "#f8f9fa",
|
|
763
|
+
accent
|
|
764
|
+
};
|
|
765
|
+
case "filled":
|
|
766
|
+
case "gradient":
|
|
767
|
+
default:
|
|
768
|
+
return {
|
|
769
|
+
background: accent,
|
|
770
|
+
foreground: "#ffffff",
|
|
771
|
+
border: TRANSPARENT,
|
|
772
|
+
borderWidth: 0,
|
|
773
|
+
pressedBackground: palette[7] ?? accent,
|
|
774
|
+
accent
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
440
779
|
// src/interpolation/replaceCalcedValues.ts
|
|
441
780
|
var PLACEHOLDER_RE = /{{({{)?([^{}]+?)(}})?}}/g;
|
|
442
781
|
function replaceCalcedValues(input, values) {
|
|
@@ -788,6 +1127,7 @@ export {
|
|
|
788
1127
|
CONTAINER_SIZE_PX,
|
|
789
1128
|
ENDPOINTS,
|
|
790
1129
|
FONT_SIZE_PX,
|
|
1130
|
+
FULL_RADIUS_PX,
|
|
791
1131
|
HEADER_CLIENT_TYPE,
|
|
792
1132
|
LINE_HEIGHT,
|
|
793
1133
|
LITERAL_CLASSES,
|
|
@@ -812,19 +1152,42 @@ export {
|
|
|
812
1152
|
getPluginStyleRegistry,
|
|
813
1153
|
getRegistryEntry,
|
|
814
1154
|
getRegistryEntryAny,
|
|
1155
|
+
getStylePlacement,
|
|
1156
|
+
getStylePlatforms,
|
|
815
1157
|
getStylePluginId,
|
|
816
1158
|
isKnownStyleName,
|
|
817
1159
|
isRegisteredStyleName,
|
|
1160
|
+
isStyleAllowedOnPage,
|
|
1161
|
+
isStylePlacementAllowed,
|
|
1162
|
+
isStyleSupportedOnPlatform,
|
|
1163
|
+
mapIntentToHeroUiButtonVariant,
|
|
1164
|
+
mapIntentToHeroUiColor,
|
|
1165
|
+
mapIntentToMantine,
|
|
1166
|
+
mapRadiusToMantine,
|
|
1167
|
+
mapRadiusToPx,
|
|
1168
|
+
mapSizeToHeroUi,
|
|
1169
|
+
mapSizeToMantine,
|
|
1170
|
+
mapSpacingToPx,
|
|
818
1171
|
parseSpacing,
|
|
819
1172
|
radiusToPx,
|
|
820
1173
|
replaceCalcedValues,
|
|
821
1174
|
resolveAssetSources,
|
|
822
1175
|
resolveAssetUrl,
|
|
1176
|
+
resolveMantineVariant,
|
|
1177
|
+
resolveSharedStyle,
|
|
1178
|
+
resolveSharedStyleForMobile,
|
|
1179
|
+
resolveSharedStyleForWeb,
|
|
1180
|
+
resolveSharedStyleProps,
|
|
1181
|
+
setToStylePlatform,
|
|
823
1182
|
sharedTailwindExtend,
|
|
824
1183
|
sharedTailwindPreset,
|
|
825
1184
|
sizeToFontPx,
|
|
826
1185
|
spacingToClasses,
|
|
827
1186
|
spacingToPx,
|
|
1187
|
+
stylePlatformToSet,
|
|
1188
|
+
toHeroUiSemanticProps,
|
|
1189
|
+
toMantineSemanticProps,
|
|
1190
|
+
toReactNativeSemanticStyle,
|
|
828
1191
|
transformPageData,
|
|
829
1192
|
transformPagesData
|
|
830
1193
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-C8sBTLJb.mjs';
|
|
2
|
-
import { I as IStyleRegistryEntry } from '../styles.registry-
|
|
3
|
-
import '../common-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-DkoT-FmN.mjs';
|
|
3
|
+
import '../common-CJSHQL1E.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* SDK contract version. Plugins declare which API they target in
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-C8sBTLJb.js';
|
|
2
|
-
import { I as IStyleRegistryEntry } from '../styles.registry-
|
|
3
|
-
import '../common-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-BV1iF7k-.js';
|
|
3
|
+
import '../common-CJSHQL1E.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* SDK contract version. Plugins declare which API they target in
|
package/dist/plugin-sdk/index.js
CHANGED
|
@@ -264,7 +264,16 @@ var BASE_STYLE_REGISTRY = {
|
|
|
264
264
|
"entry-list": { description: "Data-driven list of entries (form-log table)", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
265
265
|
"entry-record": { description: "Single-record container", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
266
266
|
"entry-record-delete": { description: "Inline delete confirmation for an entry", category: "composite", frontendOnly: true, canHaveChildren: false },
|
|
267
|
-
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true }
|
|
267
|
+
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
268
|
+
"timeline-item": { description: "A single entry inside a timeline (child-only)", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
269
|
+
// ===== system / data / reference (established backend catalog) =====
|
|
270
|
+
"no-access": { description: "Access-denied surface shown when the user lacks page access", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
271
|
+
missing: { description: 'Generic "content missing" system surface', category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
272
|
+
"not-found": { description: "Page-not-found system surface", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
273
|
+
version: { description: "Build/version diagnostic surface", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
274
|
+
"ref-container": { description: "Renders content referenced from another section", category: "layout", frontendOnly: true, canHaveChildren: true },
|
|
275
|
+
"data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout", frontendOnly: true, canHaveChildren: true },
|
|
276
|
+
"show-user-input": { description: "Displays previously submitted user input as a list/card view", category: "forms", frontendOnly: true, canHaveChildren: false }
|
|
268
277
|
};
|
|
269
278
|
var PLUGIN_STYLE_REGISTRY = {};
|
|
270
279
|
var REGISTERED_PLUGIN_KEYS = /* @__PURE__ */ new Map();
|
|
@@ -220,7 +220,16 @@ var BASE_STYLE_REGISTRY = {
|
|
|
220
220
|
"entry-list": { description: "Data-driven list of entries (form-log table)", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
221
221
|
"entry-record": { description: "Single-record container", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
222
222
|
"entry-record-delete": { description: "Inline delete confirmation for an entry", category: "composite", frontendOnly: true, canHaveChildren: false },
|
|
223
|
-
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true }
|
|
223
|
+
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
224
|
+
"timeline-item": { description: "A single entry inside a timeline (child-only)", category: "composite", frontendOnly: true, canHaveChildren: true },
|
|
225
|
+
// ===== system / data / reference (established backend catalog) =====
|
|
226
|
+
"no-access": { description: "Access-denied surface shown when the user lacks page access", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
227
|
+
missing: { description: 'Generic "content missing" system surface', category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
228
|
+
"not-found": { description: "Page-not-found system surface", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
229
|
+
version: { description: "Build/version diagnostic surface", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
230
|
+
"ref-container": { description: "Renders content referenced from another section", category: "layout", frontendOnly: true, canHaveChildren: true },
|
|
231
|
+
"data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout", frontendOnly: true, canHaveChildren: true },
|
|
232
|
+
"show-user-input": { description: "Displays previously submitted user input as a list/card view", category: "forms", frontendOnly: true, canHaveChildren: false }
|
|
224
233
|
};
|
|
225
234
|
var PLUGIN_STYLE_REGISTRY = {};
|
|
226
235
|
var REGISTERED_PLUGIN_KEYS = /* @__PURE__ */ new Map();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry } from '../styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY,
|
|
3
|
-
import '../common-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-DkoT-FmN.mjs';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-DkoT-FmN.mjs';
|
|
3
|
+
import '../common-CJSHQL1E.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Open style-name type: a core `TStyleName` literal OR any plugin style
|
|
@@ -53,5 +53,43 @@ declare function isRegisteredStyleName(name: string): boolean;
|
|
|
53
53
|
* style is not bundled in the current build.
|
|
54
54
|
*/
|
|
55
55
|
declare function getStylePluginId(name: string): string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the render targets a style supports. Unknown / unregistered
|
|
58
|
+
* styles and styles that omit `platforms` default to **both** targets,
|
|
59
|
+
* so existing styles keep rendering everywhere.
|
|
60
|
+
*
|
|
61
|
+
* The renderer should prefer an explicit per-section `platform` value
|
|
62
|
+
* from the backend payload when present; this registry lookup is the
|
|
63
|
+
* compile-time source of truth for core styles.
|
|
64
|
+
*/
|
|
65
|
+
declare function getStylePlatforms(name: string): readonly TConcretePlatform[];
|
|
66
|
+
/**
|
|
67
|
+
* Whether a style targets the given concrete platform. Drives the
|
|
68
|
+
* "silently skip styles not meant for this platform" behaviour in both
|
|
69
|
+
* the web and mobile dispatchers.
|
|
70
|
+
*/
|
|
71
|
+
declare function isStyleSupportedOnPlatform(name: string, platform: TConcretePlatform): boolean;
|
|
72
|
+
/** Expand a CMS `TStylePlatform` value into the concrete platform set. */
|
|
73
|
+
declare function stylePlatformToSet(platform: TStylePlatform): readonly TConcretePlatform[];
|
|
74
|
+
/** Collapse a concrete platform set back into the CMS `TStylePlatform` value. */
|
|
75
|
+
declare function setToStylePlatform(set: readonly TConcretePlatform[]): TStylePlatform;
|
|
76
|
+
/**
|
|
77
|
+
* Whether a style is allowed on a page that targets `pagePlatform`.
|
|
78
|
+
* A `both` page accepts every style; a single-platform page accepts only
|
|
79
|
+
* styles that also support that platform. Used by the CMS add-section
|
|
80
|
+
* picker to filter the catalog by page target.
|
|
81
|
+
*/
|
|
82
|
+
declare function isStyleAllowedOnPage(name: string, pagePlatform: TStylePlatform): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve a style's placement rule. Unknown / unregistered styles and styles
|
|
85
|
+
* that omit `placement` default to `any`.
|
|
86
|
+
*/
|
|
87
|
+
declare function getStylePlacement(name: string): TStylePlacement;
|
|
88
|
+
/**
|
|
89
|
+
* Whether a style may be placed at the given tree location. `isRoot` is true
|
|
90
|
+
* when adding directly to a page (no parent section). `rootOnly` styles are
|
|
91
|
+
* hidden inside containers; `containerOnly` styles are hidden at page root.
|
|
92
|
+
*/
|
|
93
|
+
declare function isStylePlacementAllowed(name: string, isRoot: boolean): boolean;
|
|
56
94
|
|
|
57
|
-
export { IPluginStyleRegistryEntry, IStyleRegistryEntry, type TAnyStyleName, type TPluginStyleImplMap, type TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePluginId, isKnownStyleName, isRegisteredStyleName };
|
|
95
|
+
export { IPluginStyleRegistryEntry, IStyleRegistryEntry, type TAnyStyleName, TConcretePlatform, type TPluginStyleImplMap, type TStyleImplMap, TStylePlacement, TStylePlatform, getRegistryEntry, getRegistryEntryAny, getStylePlacement, getStylePlatforms, getStylePluginId, isKnownStyleName, isRegisteredStyleName, isStyleAllowedOnPage, isStylePlacementAllowed, isStyleSupportedOnPlatform, setToStylePlatform, stylePlatformToSet };
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry } from '../styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY,
|
|
3
|
-
import '../common-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-BV1iF7k-.js';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-BV1iF7k-.js';
|
|
3
|
+
import '../common-CJSHQL1E.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Open style-name type: a core `TStyleName` literal OR any plugin style
|
|
@@ -53,5 +53,43 @@ declare function isRegisteredStyleName(name: string): boolean;
|
|
|
53
53
|
* style is not bundled in the current build.
|
|
54
54
|
*/
|
|
55
55
|
declare function getStylePluginId(name: string): string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the render targets a style supports. Unknown / unregistered
|
|
58
|
+
* styles and styles that omit `platforms` default to **both** targets,
|
|
59
|
+
* so existing styles keep rendering everywhere.
|
|
60
|
+
*
|
|
61
|
+
* The renderer should prefer an explicit per-section `platform` value
|
|
62
|
+
* from the backend payload when present; this registry lookup is the
|
|
63
|
+
* compile-time source of truth for core styles.
|
|
64
|
+
*/
|
|
65
|
+
declare function getStylePlatforms(name: string): readonly TConcretePlatform[];
|
|
66
|
+
/**
|
|
67
|
+
* Whether a style targets the given concrete platform. Drives the
|
|
68
|
+
* "silently skip styles not meant for this platform" behaviour in both
|
|
69
|
+
* the web and mobile dispatchers.
|
|
70
|
+
*/
|
|
71
|
+
declare function isStyleSupportedOnPlatform(name: string, platform: TConcretePlatform): boolean;
|
|
72
|
+
/** Expand a CMS `TStylePlatform` value into the concrete platform set. */
|
|
73
|
+
declare function stylePlatformToSet(platform: TStylePlatform): readonly TConcretePlatform[];
|
|
74
|
+
/** Collapse a concrete platform set back into the CMS `TStylePlatform` value. */
|
|
75
|
+
declare function setToStylePlatform(set: readonly TConcretePlatform[]): TStylePlatform;
|
|
76
|
+
/**
|
|
77
|
+
* Whether a style is allowed on a page that targets `pagePlatform`.
|
|
78
|
+
* A `both` page accepts every style; a single-platform page accepts only
|
|
79
|
+
* styles that also support that platform. Used by the CMS add-section
|
|
80
|
+
* picker to filter the catalog by page target.
|
|
81
|
+
*/
|
|
82
|
+
declare function isStyleAllowedOnPage(name: string, pagePlatform: TStylePlatform): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve a style's placement rule. Unknown / unregistered styles and styles
|
|
85
|
+
* that omit `placement` default to `any`.
|
|
86
|
+
*/
|
|
87
|
+
declare function getStylePlacement(name: string): TStylePlacement;
|
|
88
|
+
/**
|
|
89
|
+
* Whether a style may be placed at the given tree location. `isRoot` is true
|
|
90
|
+
* when adding directly to a page (no parent section). `rootOnly` styles are
|
|
91
|
+
* hidden inside containers; `containerOnly` styles are hidden at page root.
|
|
92
|
+
*/
|
|
93
|
+
declare function isStylePlacementAllowed(name: string, isRoot: boolean): boolean;
|
|
56
94
|
|
|
57
|
-
export { IPluginStyleRegistryEntry, IStyleRegistryEntry, type TAnyStyleName, type TPluginStyleImplMap, type TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePluginId, isKnownStyleName, isRegisteredStyleName };
|
|
95
|
+
export { IPluginStyleRegistryEntry, IStyleRegistryEntry, type TAnyStyleName, TConcretePlatform, type TPluginStyleImplMap, type TStyleImplMap, TStylePlacement, TStylePlatform, getRegistryEntry, getRegistryEntryAny, getStylePlacement, getStylePlatforms, getStylePluginId, isKnownStyleName, isRegisteredStyleName, isStyleAllowedOnPage, isStylePlacementAllowed, isStyleSupportedOnPlatform, setToStylePlatform, stylePlatformToSet };
|