@selfhelp/shared 1.0.1 → 1.0.4
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 +4 -0
- package/dist/index.d.mts +19 -13
- package/dist/index.d.ts +19 -13
- package/dist/index.js +96 -6
- package/dist/index.mjs +88 -6
- package/dist/plugin-sdk/index.d.mts +906 -0
- package/dist/plugin-sdk/index.d.ts +906 -0
- package/dist/plugin-sdk/index.js +490 -0
- package/dist/plugin-sdk/index.mjs +452 -0
- package/dist/registry/index.d.mts +56 -1
- package/dist/registry/index.d.ts +56 -1
- package/dist/registry/index.js +94 -5
- package/dist/registry/index.mjs +85 -4
- package/dist/{index-Bg60YTsF.d.mts → styles.registry-C3bux91U.d.mts} +569 -28
- package/dist/{index-DEOVT86P.d.ts → styles.registry-Cr961HQ0.d.ts} +569 -28
- package/package.json +19 -3
- package/src/plugin-sdk/define.ts +89 -0
- package/src/plugin-sdk/index.ts +91 -0
- package/src/plugin-sdk/lock.ts +124 -0
- package/src/plugin-sdk/manifest.ts +295 -0
- package/src/plugin-sdk/realtime.ts +277 -0
- package/src/plugin-sdk/registry.ts +95 -0
- package/src/plugin-sdk/types.ts +265 -0
- package/src/plugin-sdk/version.ts +209 -0
- package/src/registry/index.ts +68 -11
- package/src/registry/styles.registry.ts +149 -12
- package/src/types/pages.ts +2 -2
- package/src/utils/transformPageData.ts +18 -12
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
This project follows semantic versioning.
|
|
6
6
|
|
|
7
|
+
## [1.0.3] - 2026-05-19
|
|
8
|
+
|
|
9
|
+
- Adjust types after the DB refactoring
|
|
10
|
+
|
|
7
11
|
## [1.0.0] - 2026-05-08
|
|
8
12
|
|
|
9
13
|
First stable release of `@selfhelp/shared`.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { T as TStyleName,
|
|
2
|
-
export {
|
|
1
|
+
import { T as TStyleName, f as IContentField } from './styles.registry-C3bux91U.mjs';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, h as IAccordionItemStyle, i as IAccordionStyle, j as IActionIconStyle, k as IAlertStyle, l as IAspectRatioStyle, m as IAudioStyle, n as IAvatarStyle, o as IBackgroundImageStyle, p as IBadgeStyle, q as IBaseStyle, r as IBlockquoteStyle, s as IBoxStyle, t as IButtonStyle, u as ICardSegmentStyle, v as ICardStyle, w as ICarouselStyle, x as ICenterStyle, y as ICheckboxStyle, z as IChipStyle, A as ICodeStyle, C as IColorInputStyle, D as IColorPickerStyle, E as IComboboxStyle, F as IContainerStyle, G as IDatePickerStyle, H as IDividerStyle, J as IEntryListStyle, K as IEntryRecordDeleteStyle, L as IEntryRecordStyle, M as IFieldsetStyle, N as IFigureStyle, O as IFileInputStyle, P as IFlexStyle, Q as IFormLogStyle, R as IFormRecordStyle, U as IFormStyle, V as IGridColumnStyle, W as IGridStyle, X as IGroupStyle, Y as IHighlightStyle, Z as IHtmlTagStyle, $ as IImageStyle, a0 as IIndicatorStyle, a1 as IInputStyle, a2 as IKbdStyle, a3 as ILinkStyle, a4 as IListItemStyle, a5 as IListStyle, a6 as ILoginStyle, a7 as ILoopStyle, a8 as INotificationStyle, a9 as INumberInputStyle, aa as IPaperStyle, a as IPluginStyleRegistryEntry, ab as IProfileStyle, ac as IProgressRootStyle, ad as IProgressSectionStyle, ae as IProgressStyle, af as IRadioStyle, ag as IRangeSliderStyle, ah as IRatingStyle, ai as IRegisterStyle, aj as IResetPasswordStyle, ak as IRichTextEditorStyle, al as IScrollAreaStyle, am as ISegmentedControlStyle, an as ISelectStyle, ao as ISimpleGridStyle, ap as ISliderStyle, aq as ISpaceStyle, ar as ISpoilerStyle, as as IStackStyle, I as IStyleRegistryEntry, at as IStyleWithSpacing, au as ISwitchStyle, av as ITabStyle, aw as ITabsStyle, ax as ITextInputStyle, ay as ITextStyle, az as ITextareaStyle, aA as IThemeIconStyle, aB as ITimelineStyle, aC as ITitleStyle, aD as ITwoFactorAuthStyle, aE as ITypographyStyle, aF as IUnknownStyle, aG as IValidateStyle, aH as IVideoStyle, S as STYLE_REGISTRY, aI as TMantineAccordionChevronPosition, aJ as TMantineAccordionDisableChevronRotation, aK as TMantineAccordionLoop, aL as TMantineAccordionMultiple, aM as TMantineBorder, aN as TMantineCardShadow, aO as TMantineCheckboxLabelPosition, aP as TMantineCols, aQ as TMantineDividerVariant, aR as TMantineGap, aS as TMantineGridOffset, aT as TMantineGridOrder, aU as TMantineHeight, aV as TMantineIconSize, aW as TMantineImageFit, aX as TMantineLineClamp, aY as TMantineListCenter, aZ as TMantineListStyleType, a_ as TMantineListType, a$ as TMantineListWithPadding, b0 as TMantinePaperShadow, b1 as TMantineProgressTransition, b2 as TMantineScrollAreaSize, b3 as TMantineScrollAreaType, b4 as TMantineTextAlign, b5 as TMantineTextDecoration, b6 as TMantineTextFontStyle, b7 as TMantineTextFontWeight, b8 as TMantineTextInherit, b9 as TMantineTextInputVariant, ba as TMantineTextSpan, bb as TMantineTextTransform, bc as TMantineTextTruncate, bd as TMantineTextVariant, be as TMantineTextareaAutosize, bf as TMantineTextareaResize, bg as TMantineTextareaVariant, bh as TMantineTimelineAlign, bi as TMantineTitleLineClamp, bj as TMantineTitleTextWrap, bk as TMantineTranslatable, bl as TMantineUseInputWrapper, bm as TMantineWidth, bn as TStyle, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from './styles.registry-C3bux91U.mjs';
|
|
3
3
|
export { s as TMantineAccordionVariant, v as TMantineActionIconLoading, d as TMantineAlign, w as TMantineAllowNextClicks, x as TMantineAllowStepClick, y as TMantineAspectRatio, z as TMantineAutoContrast, o as TMantineAvatarVariant, n as TMantineBadgeVariant, A as TMantineBlock, B as TMantineCenterInline, C as TMantineChecked, D as TMantineChipChecked, E as TMantineChipMultiple, p as TMantineChipVariant, F as TMantineClampBehavior, G as TMantineCodeBlock, i as TMantineColor, H as TMantineColorFormat, I as TMantineColorInputSwatches, J as TMantineColorPickerSwatches, K as TMantineColorPickerSwatchesPerRow, L as TMantineCompact, M as TMantineContainerFluid, e as TMantineDirection, N as TMantineDisabled, k as TMantineFieldsetVariant, O as TMantineFileAccept, P as TMantineFileInputMultiple, Q as TMantineFluid, R as TMantineFullWidth, S as TMantineGridGrow, U as TMantineGridOverflow, g as TMantineGridSpan, V as TMantineGroupGrow, W as TMantineGroupWrap, X as TMantineGrow, Y as TMantineHighlight, q as TMantineIndicatorPosition, Z as TMantineInline, _ as TMantineIsLink, c as TMantineJustify, $ as TMantineKbdSize, a0 as TMantineLoading, a1 as TMantineMultiple, a2 as TMantineNotificationWithCloseButton, a3 as TMantineNumberInputDecimalScale, a4 as TMantineOpenInNewTab, h as TMantineOrientation, a5 as TMantineProcessing, T as TMantineRadius, a6 as TMantineRangeSliderMarks, a7 as TMantineRatingCount, a8 as TMantineRatingFractions, a9 as TMantineRatingReadonly, aa as TMantineReadonly, a as TMantineSize, ab as TMantineSpaceHorizontal, b as TMantineSpacing, l as TMantineSpoilerMaxHeight, ac as TMantineSwatches, ad as TMantineTabDisabled, t as TMantineTabsVariant, r as TMantineThemeIconVariant, u as TMantineTimelineLineVariant, j as TMantineTitleOrder, ae as TMantineUseMantineStyle, m as TMantineVariant, af as TMantineWithCloseButton, ag as TMantineWithIcon, f as TMantineWrap } from './common-B96dASgu.mjs';
|
|
4
|
+
export { TAnyStyleName, TPluginStyleImplMap, TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePluginId, isKnownStyleName, isRegisteredStyleName } from './registry/index.mjs';
|
|
4
5
|
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, TCanonicalColor, TCanonicalRadius, TCanonicalSpacing, colorToHex, radiusToPx, sizeToFontPx, spacingToPx } from './theme/index.mjs';
|
|
5
6
|
export { sharedTailwindExtend, sharedTailwindPreset } from './theme/tailwind.mjs';
|
|
6
7
|
|
|
@@ -55,8 +56,8 @@ interface IPageItem extends IBasePageInfo {
|
|
|
55
56
|
acl_insert?: 0 | 1;
|
|
56
57
|
acl_update?: 0 | 1;
|
|
57
58
|
acl_delete?: 0 | 1;
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
id_page_types?: number;
|
|
60
|
+
id_page_access_types?: number;
|
|
60
61
|
title?: string | null;
|
|
61
62
|
description?: string | null;
|
|
62
63
|
children?: IPageItem[];
|
|
@@ -550,15 +551,20 @@ declare function spacingToClasses(spacing: ISpacingValue, spacingToTailwind: Rec
|
|
|
550
551
|
/**
|
|
551
552
|
* Backend → frontend page-shape transformer.
|
|
552
553
|
*
|
|
553
|
-
* The Symfony
|
|
554
|
-
* (`nav_position`, `footer_position`, `id_pages`, `
|
|
555
|
-
*
|
|
556
|
-
* (`navPosition`, `footerPosition`) at the type-system
|
|
557
|
-
* helper bridges the two so consumers don't have to know
|
|
558
|
-
* snake-case wire format.
|
|
554
|
+
* The Symfony backend projects pages with canonical `snake_case` keys
|
|
555
|
+
* (`nav_position`, `footer_position`, `id_pages`, `id_parent_page`,
|
|
556
|
+
* `id_page_types`, `id_page_access_types`). The web and mobile apps
|
|
557
|
+
* prefer camelCase (`navPosition`, `footerPosition`) at the type-system
|
|
558
|
+
* level. This helper bridges the two so consumers don't have to know
|
|
559
|
+
* about the snake-case wire format.
|
|
559
560
|
*
|
|
560
561
|
* It is the single source of truth for the conversion. Web frontend
|
|
561
562
|
* and mobile both import it from `@selfhelp/shared`.
|
|
563
|
+
*
|
|
564
|
+
* NOTE: Pre-release breaking-change cutover (`db_naming_cutover_*`)
|
|
565
|
+
* removed all legacy aliases (`parent`, `id_type`,
|
|
566
|
+
* `id_pageAccessTypes`). The backend is the single source of canonical
|
|
567
|
+
* keys; the transformer no longer accepts the legacy shapes.
|
|
562
568
|
*/
|
|
563
569
|
|
|
564
570
|
interface IRawPage {
|
|
@@ -566,7 +572,7 @@ interface IRawPage {
|
|
|
566
572
|
id_pages?: number;
|
|
567
573
|
keyword?: string;
|
|
568
574
|
url?: string | null;
|
|
569
|
-
|
|
575
|
+
id_parent_page?: number | null;
|
|
570
576
|
parent_page_id?: number | null;
|
|
571
577
|
is_headless?: number | boolean | null;
|
|
572
578
|
nav_position?: number | null;
|
|
@@ -582,8 +588,8 @@ interface IRawPage {
|
|
|
582
588
|
acl_insert?: 0 | 1;
|
|
583
589
|
acl_update?: 0 | 1;
|
|
584
590
|
acl_delete?: 0 | 1;
|
|
585
|
-
|
|
586
|
-
|
|
591
|
+
id_page_types?: number;
|
|
592
|
+
id_page_access_types?: number;
|
|
587
593
|
children?: IRawPage[];
|
|
588
594
|
[key: string]: unknown;
|
|
589
595
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { T as TStyleName,
|
|
2
|
-
export {
|
|
1
|
+
import { T as TStyleName, f as IContentField } from './styles.registry-Cr961HQ0.js';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, h as IAccordionItemStyle, i as IAccordionStyle, j as IActionIconStyle, k as IAlertStyle, l as IAspectRatioStyle, m as IAudioStyle, n as IAvatarStyle, o as IBackgroundImageStyle, p as IBadgeStyle, q as IBaseStyle, r as IBlockquoteStyle, s as IBoxStyle, t as IButtonStyle, u as ICardSegmentStyle, v as ICardStyle, w as ICarouselStyle, x as ICenterStyle, y as ICheckboxStyle, z as IChipStyle, A as ICodeStyle, C as IColorInputStyle, D as IColorPickerStyle, E as IComboboxStyle, F as IContainerStyle, G as IDatePickerStyle, H as IDividerStyle, J as IEntryListStyle, K as IEntryRecordDeleteStyle, L as IEntryRecordStyle, M as IFieldsetStyle, N as IFigureStyle, O as IFileInputStyle, P as IFlexStyle, Q as IFormLogStyle, R as IFormRecordStyle, U as IFormStyle, V as IGridColumnStyle, W as IGridStyle, X as IGroupStyle, Y as IHighlightStyle, Z as IHtmlTagStyle, $ as IImageStyle, a0 as IIndicatorStyle, a1 as IInputStyle, a2 as IKbdStyle, a3 as ILinkStyle, a4 as IListItemStyle, a5 as IListStyle, a6 as ILoginStyle, a7 as ILoopStyle, a8 as INotificationStyle, a9 as INumberInputStyle, aa as IPaperStyle, a as IPluginStyleRegistryEntry, ab as IProfileStyle, ac as IProgressRootStyle, ad as IProgressSectionStyle, ae as IProgressStyle, af as IRadioStyle, ag as IRangeSliderStyle, ah as IRatingStyle, ai as IRegisterStyle, aj as IResetPasswordStyle, ak as IRichTextEditorStyle, al as IScrollAreaStyle, am as ISegmentedControlStyle, an as ISelectStyle, ao as ISimpleGridStyle, ap as ISliderStyle, aq as ISpaceStyle, ar as ISpoilerStyle, as as IStackStyle, I as IStyleRegistryEntry, at as IStyleWithSpacing, au as ISwitchStyle, av as ITabStyle, aw as ITabsStyle, ax as ITextInputStyle, ay as ITextStyle, az as ITextareaStyle, aA as IThemeIconStyle, aB as ITimelineStyle, aC as ITitleStyle, aD as ITwoFactorAuthStyle, aE as ITypographyStyle, aF as IUnknownStyle, aG as IValidateStyle, aH as IVideoStyle, S as STYLE_REGISTRY, aI as TMantineAccordionChevronPosition, aJ as TMantineAccordionDisableChevronRotation, aK as TMantineAccordionLoop, aL as TMantineAccordionMultiple, aM as TMantineBorder, aN as TMantineCardShadow, aO as TMantineCheckboxLabelPosition, aP as TMantineCols, aQ as TMantineDividerVariant, aR as TMantineGap, aS as TMantineGridOffset, aT as TMantineGridOrder, aU as TMantineHeight, aV as TMantineIconSize, aW as TMantineImageFit, aX as TMantineLineClamp, aY as TMantineListCenter, aZ as TMantineListStyleType, a_ as TMantineListType, a$ as TMantineListWithPadding, b0 as TMantinePaperShadow, b1 as TMantineProgressTransition, b2 as TMantineScrollAreaSize, b3 as TMantineScrollAreaType, b4 as TMantineTextAlign, b5 as TMantineTextDecoration, b6 as TMantineTextFontStyle, b7 as TMantineTextFontWeight, b8 as TMantineTextInherit, b9 as TMantineTextInputVariant, ba as TMantineTextSpan, bb as TMantineTextTransform, bc as TMantineTextTruncate, bd as TMantineTextVariant, be as TMantineTextareaAutosize, bf as TMantineTextareaResize, bg as TMantineTextareaVariant, bh as TMantineTimelineAlign, bi as TMantineTitleLineClamp, bj as TMantineTitleTextWrap, bk as TMantineTranslatable, bl as TMantineUseInputWrapper, bm as TMantineWidth, bn as TStyle, b as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, c as _resetPluginStyleRegistry, e as extendStyleRegistry, g as getMergedStyleRegistry, d as getPluginStyleRegistry } from './styles.registry-Cr961HQ0.js';
|
|
3
3
|
export { s as TMantineAccordionVariant, v as TMantineActionIconLoading, d as TMantineAlign, w as TMantineAllowNextClicks, x as TMantineAllowStepClick, y as TMantineAspectRatio, z as TMantineAutoContrast, o as TMantineAvatarVariant, n as TMantineBadgeVariant, A as TMantineBlock, B as TMantineCenterInline, C as TMantineChecked, D as TMantineChipChecked, E as TMantineChipMultiple, p as TMantineChipVariant, F as TMantineClampBehavior, G as TMantineCodeBlock, i as TMantineColor, H as TMantineColorFormat, I as TMantineColorInputSwatches, J as TMantineColorPickerSwatches, K as TMantineColorPickerSwatchesPerRow, L as TMantineCompact, M as TMantineContainerFluid, e as TMantineDirection, N as TMantineDisabled, k as TMantineFieldsetVariant, O as TMantineFileAccept, P as TMantineFileInputMultiple, Q as TMantineFluid, R as TMantineFullWidth, S as TMantineGridGrow, U as TMantineGridOverflow, g as TMantineGridSpan, V as TMantineGroupGrow, W as TMantineGroupWrap, X as TMantineGrow, Y as TMantineHighlight, q as TMantineIndicatorPosition, Z as TMantineInline, _ as TMantineIsLink, c as TMantineJustify, $ as TMantineKbdSize, a0 as TMantineLoading, a1 as TMantineMultiple, a2 as TMantineNotificationWithCloseButton, a3 as TMantineNumberInputDecimalScale, a4 as TMantineOpenInNewTab, h as TMantineOrientation, a5 as TMantineProcessing, T as TMantineRadius, a6 as TMantineRangeSliderMarks, a7 as TMantineRatingCount, a8 as TMantineRatingFractions, a9 as TMantineRatingReadonly, aa as TMantineReadonly, a as TMantineSize, ab as TMantineSpaceHorizontal, b as TMantineSpacing, l as TMantineSpoilerMaxHeight, ac as TMantineSwatches, ad as TMantineTabDisabled, t as TMantineTabsVariant, r as TMantineThemeIconVariant, u as TMantineTimelineLineVariant, j as TMantineTitleOrder, ae as TMantineUseMantineStyle, m as TMantineVariant, af as TMantineWithCloseButton, ag as TMantineWithIcon, f as TMantineWrap } from './common-B96dASgu.js';
|
|
4
|
+
export { TAnyStyleName, TPluginStyleImplMap, TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePluginId, isKnownStyleName, isRegisteredStyleName } from './registry/index.js';
|
|
4
5
|
export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, ISpacingResolved, LINE_HEIGHT, RADIUS_PX, SPACING_PX, SPACING_TO_TAILWIND, TCanonicalColor, TCanonicalRadius, TCanonicalSpacing, colorToHex, radiusToPx, sizeToFontPx, spacingToPx } from './theme/index.js';
|
|
5
6
|
export { sharedTailwindExtend, sharedTailwindPreset } from './theme/tailwind.js';
|
|
6
7
|
|
|
@@ -55,8 +56,8 @@ interface IPageItem extends IBasePageInfo {
|
|
|
55
56
|
acl_insert?: 0 | 1;
|
|
56
57
|
acl_update?: 0 | 1;
|
|
57
58
|
acl_delete?: 0 | 1;
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
id_page_types?: number;
|
|
60
|
+
id_page_access_types?: number;
|
|
60
61
|
title?: string | null;
|
|
61
62
|
description?: string | null;
|
|
62
63
|
children?: IPageItem[];
|
|
@@ -550,15 +551,20 @@ declare function spacingToClasses(spacing: ISpacingValue, spacingToTailwind: Rec
|
|
|
550
551
|
/**
|
|
551
552
|
* Backend → frontend page-shape transformer.
|
|
552
553
|
*
|
|
553
|
-
* The Symfony
|
|
554
|
-
* (`nav_position`, `footer_position`, `id_pages`, `
|
|
555
|
-
*
|
|
556
|
-
* (`navPosition`, `footerPosition`) at the type-system
|
|
557
|
-
* helper bridges the two so consumers don't have to know
|
|
558
|
-
* snake-case wire format.
|
|
554
|
+
* The Symfony backend projects pages with canonical `snake_case` keys
|
|
555
|
+
* (`nav_position`, `footer_position`, `id_pages`, `id_parent_page`,
|
|
556
|
+
* `id_page_types`, `id_page_access_types`). The web and mobile apps
|
|
557
|
+
* prefer camelCase (`navPosition`, `footerPosition`) at the type-system
|
|
558
|
+
* level. This helper bridges the two so consumers don't have to know
|
|
559
|
+
* about the snake-case wire format.
|
|
559
560
|
*
|
|
560
561
|
* It is the single source of truth for the conversion. Web frontend
|
|
561
562
|
* and mobile both import it from `@selfhelp/shared`.
|
|
563
|
+
*
|
|
564
|
+
* NOTE: Pre-release breaking-change cutover (`db_naming_cutover_*`)
|
|
565
|
+
* removed all legacy aliases (`parent`, `id_type`,
|
|
566
|
+
* `id_pageAccessTypes`). The backend is the single source of canonical
|
|
567
|
+
* keys; the transformer no longer accepts the legacy shapes.
|
|
562
568
|
*/
|
|
563
569
|
|
|
564
570
|
interface IRawPage {
|
|
@@ -566,7 +572,7 @@ interface IRawPage {
|
|
|
566
572
|
id_pages?: number;
|
|
567
573
|
keyword?: string;
|
|
568
574
|
url?: string | null;
|
|
569
|
-
|
|
575
|
+
id_parent_page?: number | null;
|
|
570
576
|
parent_page_id?: number | null;
|
|
571
577
|
is_headless?: number | boolean | null;
|
|
572
578
|
nav_position?: number | null;
|
|
@@ -582,8 +588,8 @@ interface IRawPage {
|
|
|
582
588
|
acl_insert?: 0 | 1;
|
|
583
589
|
acl_update?: 0 | 1;
|
|
584
590
|
acl_delete?: 0 | 1;
|
|
585
|
-
|
|
586
|
-
|
|
591
|
+
id_page_types?: number;
|
|
592
|
+
id_page_access_types?: number;
|
|
587
593
|
children?: IRawPage[];
|
|
588
594
|
[key: string]: unknown;
|
|
589
595
|
}
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
API_VERSION_PREFIX: () => API_VERSION_PREFIX,
|
|
34
|
+
BASE_STYLE_REGISTRY: () => BASE_STYLE_REGISTRY,
|
|
34
35
|
CLASS_PATTERNS: () => CLASS_PATTERNS,
|
|
35
36
|
CLASS_REMAP: () => CLASS_REMAP,
|
|
36
37
|
CLIENT_TYPE_MOBILE: () => CLIENT_TYPE_MOBILE,
|
|
@@ -52,14 +53,21 @@ __export(index_exports, {
|
|
|
52
53
|
SPACING_TO_TAILWIND: () => SPACING_TO_TAILWIND,
|
|
53
54
|
SPACING_VALUES: () => SPACING_VALUES,
|
|
54
55
|
STYLE_REGISTRY: () => STYLE_REGISTRY,
|
|
56
|
+
_resetPluginStyleRegistry: () => _resetPluginStyleRegistry,
|
|
55
57
|
buildConditionContext: () => buildConditionContext,
|
|
56
58
|
classifyClass: () => classifyClass,
|
|
57
59
|
classifyClassString: () => classifyClassString,
|
|
58
60
|
colorToHex: () => colorToHex,
|
|
59
61
|
evaluateCondition: () => evaluateCondition,
|
|
62
|
+
extendStyleRegistry: () => extendStyleRegistry,
|
|
60
63
|
findRemap: () => findRemap,
|
|
64
|
+
getMergedStyleRegistry: () => getMergedStyleRegistry,
|
|
65
|
+
getPluginStyleRegistry: () => getPluginStyleRegistry,
|
|
61
66
|
getRegistryEntry: () => getRegistryEntry,
|
|
67
|
+
getRegistryEntryAny: () => getRegistryEntryAny,
|
|
68
|
+
getStylePluginId: () => getStylePluginId,
|
|
62
69
|
isKnownStyleName: () => isKnownStyleName,
|
|
70
|
+
isRegisteredStyleName: () => isRegisteredStyleName,
|
|
63
71
|
parseSpacing: () => parseSpacing,
|
|
64
72
|
radiusToPx: () => radiusToPx,
|
|
65
73
|
replaceCalcedValues: () => replaceCalcedValues,
|
|
@@ -127,7 +135,7 @@ var PERMISSIONS = {
|
|
|
127
135
|
};
|
|
128
136
|
|
|
129
137
|
// src/registry/styles.registry.ts
|
|
130
|
-
var
|
|
138
|
+
var BASE_STYLE_REGISTRY = {
|
|
131
139
|
// ===== auth =====
|
|
132
140
|
login: { description: "User login form", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
133
141
|
register: { description: "User registration form", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
@@ -218,13 +226,86 @@ var STYLE_REGISTRY = {
|
|
|
218
226
|
entryRecordDelete: { description: "Inline delete confirmation for an entry", category: "composite", frontendOnly: true, canHaveChildren: false },
|
|
219
227
|
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true }
|
|
220
228
|
};
|
|
229
|
+
var STYLE_REGISTRY = BASE_STYLE_REGISTRY;
|
|
230
|
+
var PLUGIN_STYLE_REGISTRY = {};
|
|
231
|
+
var REGISTERED_PLUGIN_KEYS = /* @__PURE__ */ new Map();
|
|
232
|
+
function extendStyleRegistry(entries, options) {
|
|
233
|
+
const { pluginId, pluginVersion } = options;
|
|
234
|
+
const ownedKeys = REGISTERED_PLUGIN_KEYS.get(pluginId) ?? /* @__PURE__ */ new Set();
|
|
235
|
+
const addedKeys = [];
|
|
236
|
+
for (const [name, entry] of Object.entries(entries)) {
|
|
237
|
+
if (Object.prototype.hasOwnProperty.call(BASE_STYLE_REGISTRY, name)) {
|
|
238
|
+
throw new Error(
|
|
239
|
+
`[shared/registry] plugin '${pluginId}' tried to register core style '${name}'.`
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
const existing = PLUGIN_STYLE_REGISTRY[name];
|
|
243
|
+
if (existing && existing.pluginId !== pluginId) {
|
|
244
|
+
throw new Error(
|
|
245
|
+
`[shared/registry] plugin '${pluginId}' tried to register style '${name}' already owned by '${existing.pluginId}'.`
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
PLUGIN_STYLE_REGISTRY[name] = {
|
|
249
|
+
...entry,
|
|
250
|
+
pluginId,
|
|
251
|
+
pluginVersion
|
|
252
|
+
};
|
|
253
|
+
ownedKeys.add(name);
|
|
254
|
+
addedKeys.push(name);
|
|
255
|
+
}
|
|
256
|
+
REGISTERED_PLUGIN_KEYS.set(pluginId, ownedKeys);
|
|
257
|
+
return function dispose() {
|
|
258
|
+
for (const key of addedKeys) {
|
|
259
|
+
const existing = PLUGIN_STYLE_REGISTRY[key];
|
|
260
|
+
if (existing && existing.pluginId === pluginId) {
|
|
261
|
+
delete PLUGIN_STYLE_REGISTRY[key];
|
|
262
|
+
ownedKeys.delete(key);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (ownedKeys.size === 0) {
|
|
266
|
+
REGISTERED_PLUGIN_KEYS.delete(pluginId);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function getMergedStyleRegistry() {
|
|
271
|
+
return {
|
|
272
|
+
...BASE_STYLE_REGISTRY,
|
|
273
|
+
...PLUGIN_STYLE_REGISTRY
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function getPluginStyleRegistry() {
|
|
277
|
+
return { ...PLUGIN_STYLE_REGISTRY };
|
|
278
|
+
}
|
|
279
|
+
function _resetPluginStyleRegistry() {
|
|
280
|
+
for (const key of Object.keys(PLUGIN_STYLE_REGISTRY)) {
|
|
281
|
+
delete PLUGIN_STYLE_REGISTRY[key];
|
|
282
|
+
}
|
|
283
|
+
REGISTERED_PLUGIN_KEYS.clear();
|
|
284
|
+
}
|
|
221
285
|
|
|
222
286
|
// src/registry/index.ts
|
|
223
287
|
function getRegistryEntry(name) {
|
|
224
|
-
|
|
288
|
+
if (Object.prototype.hasOwnProperty.call(BASE_STYLE_REGISTRY, name)) {
|
|
289
|
+
return BASE_STYLE_REGISTRY[name];
|
|
290
|
+
}
|
|
291
|
+
return void 0;
|
|
292
|
+
}
|
|
293
|
+
function getRegistryEntryAny(name) {
|
|
294
|
+
const merged = getMergedStyleRegistry();
|
|
295
|
+
return merged[name];
|
|
225
296
|
}
|
|
226
297
|
function isKnownStyleName(name) {
|
|
227
|
-
return Object.prototype.hasOwnProperty.call(
|
|
298
|
+
return Object.prototype.hasOwnProperty.call(BASE_STYLE_REGISTRY, name);
|
|
299
|
+
}
|
|
300
|
+
function isRegisteredStyleName(name) {
|
|
301
|
+
if (Object.prototype.hasOwnProperty.call(BASE_STYLE_REGISTRY, name)) {
|
|
302
|
+
return true;
|
|
303
|
+
}
|
|
304
|
+
return Object.prototype.hasOwnProperty.call(getPluginStyleRegistry(), name);
|
|
305
|
+
}
|
|
306
|
+
function getStylePluginId(name) {
|
|
307
|
+
const plugin = getPluginStyleRegistry()[name];
|
|
308
|
+
return plugin?.pluginId;
|
|
228
309
|
}
|
|
229
310
|
|
|
230
311
|
// src/api/endpoints.ts
|
|
@@ -723,11 +804,12 @@ function toBool(value) {
|
|
|
723
804
|
}
|
|
724
805
|
function transformPageData(apiPage) {
|
|
725
806
|
const id = apiPage.id ?? apiPage.id_pages ?? 0;
|
|
807
|
+
const parentPageId = apiPage.parent_page_id ?? apiPage.id_parent_page ?? null;
|
|
726
808
|
return {
|
|
727
809
|
id,
|
|
728
810
|
keyword: apiPage.keyword ?? "",
|
|
729
811
|
url: apiPage.url ?? null,
|
|
730
|
-
parent_page_id:
|
|
812
|
+
parent_page_id: parentPageId,
|
|
731
813
|
is_headless: toBool(apiPage.is_headless),
|
|
732
814
|
navPosition: apiPage.navPosition !== void 0 ? apiPage.navPosition : apiPage.nav_position ?? null,
|
|
733
815
|
footerPosition: apiPage.footerPosition !== void 0 ? apiPage.footerPosition : apiPage.footer_position ?? null,
|
|
@@ -741,8 +823,8 @@ function transformPageData(apiPage) {
|
|
|
741
823
|
acl_insert: apiPage.acl_insert,
|
|
742
824
|
acl_update: apiPage.acl_update,
|
|
743
825
|
acl_delete: apiPage.acl_delete,
|
|
744
|
-
|
|
745
|
-
|
|
826
|
+
id_page_types: apiPage.id_page_types,
|
|
827
|
+
id_page_access_types: apiPage.id_page_access_types
|
|
746
828
|
};
|
|
747
829
|
}
|
|
748
830
|
function transformPagesData(pages) {
|
|
@@ -752,6 +834,7 @@ function transformPagesData(pages) {
|
|
|
752
834
|
// Annotate the CommonJS export names for ESM import in node:
|
|
753
835
|
0 && (module.exports = {
|
|
754
836
|
API_VERSION_PREFIX,
|
|
837
|
+
BASE_STYLE_REGISTRY,
|
|
755
838
|
CLASS_PATTERNS,
|
|
756
839
|
CLASS_REMAP,
|
|
757
840
|
CLIENT_TYPE_MOBILE,
|
|
@@ -773,14 +856,21 @@ function transformPagesData(pages) {
|
|
|
773
856
|
SPACING_TO_TAILWIND,
|
|
774
857
|
SPACING_VALUES,
|
|
775
858
|
STYLE_REGISTRY,
|
|
859
|
+
_resetPluginStyleRegistry,
|
|
776
860
|
buildConditionContext,
|
|
777
861
|
classifyClass,
|
|
778
862
|
classifyClassString,
|
|
779
863
|
colorToHex,
|
|
780
864
|
evaluateCondition,
|
|
865
|
+
extendStyleRegistry,
|
|
781
866
|
findRemap,
|
|
867
|
+
getMergedStyleRegistry,
|
|
868
|
+
getPluginStyleRegistry,
|
|
782
869
|
getRegistryEntry,
|
|
870
|
+
getRegistryEntryAny,
|
|
871
|
+
getStylePluginId,
|
|
783
872
|
isKnownStyleName,
|
|
873
|
+
isRegisteredStyleName,
|
|
784
874
|
parseSpacing,
|
|
785
875
|
radiusToPx,
|
|
786
876
|
replaceCalcedValues,
|
package/dist/index.mjs
CHANGED
|
@@ -50,7 +50,7 @@ var PERMISSIONS = {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
// src/registry/styles.registry.ts
|
|
53
|
-
var
|
|
53
|
+
var BASE_STYLE_REGISTRY = {
|
|
54
54
|
// ===== auth =====
|
|
55
55
|
login: { description: "User login form", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
56
56
|
register: { description: "User registration form", category: "auth", frontendOnly: true, canHaveChildren: false },
|
|
@@ -141,13 +141,86 @@ var STYLE_REGISTRY = {
|
|
|
141
141
|
entryRecordDelete: { description: "Inline delete confirmation for an entry", category: "composite", frontendOnly: true, canHaveChildren: false },
|
|
142
142
|
loop: { description: "Loop / repeater over backend-provided rows", category: "composite", frontendOnly: true, canHaveChildren: true }
|
|
143
143
|
};
|
|
144
|
+
var STYLE_REGISTRY = BASE_STYLE_REGISTRY;
|
|
145
|
+
var PLUGIN_STYLE_REGISTRY = {};
|
|
146
|
+
var REGISTERED_PLUGIN_KEYS = /* @__PURE__ */ new Map();
|
|
147
|
+
function extendStyleRegistry(entries, options) {
|
|
148
|
+
const { pluginId, pluginVersion } = options;
|
|
149
|
+
const ownedKeys = REGISTERED_PLUGIN_KEYS.get(pluginId) ?? /* @__PURE__ */ new Set();
|
|
150
|
+
const addedKeys = [];
|
|
151
|
+
for (const [name, entry] of Object.entries(entries)) {
|
|
152
|
+
if (Object.prototype.hasOwnProperty.call(BASE_STYLE_REGISTRY, name)) {
|
|
153
|
+
throw new Error(
|
|
154
|
+
`[shared/registry] plugin '${pluginId}' tried to register core style '${name}'.`
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
const existing = PLUGIN_STYLE_REGISTRY[name];
|
|
158
|
+
if (existing && existing.pluginId !== pluginId) {
|
|
159
|
+
throw new Error(
|
|
160
|
+
`[shared/registry] plugin '${pluginId}' tried to register style '${name}' already owned by '${existing.pluginId}'.`
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
PLUGIN_STYLE_REGISTRY[name] = {
|
|
164
|
+
...entry,
|
|
165
|
+
pluginId,
|
|
166
|
+
pluginVersion
|
|
167
|
+
};
|
|
168
|
+
ownedKeys.add(name);
|
|
169
|
+
addedKeys.push(name);
|
|
170
|
+
}
|
|
171
|
+
REGISTERED_PLUGIN_KEYS.set(pluginId, ownedKeys);
|
|
172
|
+
return function dispose() {
|
|
173
|
+
for (const key of addedKeys) {
|
|
174
|
+
const existing = PLUGIN_STYLE_REGISTRY[key];
|
|
175
|
+
if (existing && existing.pluginId === pluginId) {
|
|
176
|
+
delete PLUGIN_STYLE_REGISTRY[key];
|
|
177
|
+
ownedKeys.delete(key);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (ownedKeys.size === 0) {
|
|
181
|
+
REGISTERED_PLUGIN_KEYS.delete(pluginId);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function getMergedStyleRegistry() {
|
|
186
|
+
return {
|
|
187
|
+
...BASE_STYLE_REGISTRY,
|
|
188
|
+
...PLUGIN_STYLE_REGISTRY
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function getPluginStyleRegistry() {
|
|
192
|
+
return { ...PLUGIN_STYLE_REGISTRY };
|
|
193
|
+
}
|
|
194
|
+
function _resetPluginStyleRegistry() {
|
|
195
|
+
for (const key of Object.keys(PLUGIN_STYLE_REGISTRY)) {
|
|
196
|
+
delete PLUGIN_STYLE_REGISTRY[key];
|
|
197
|
+
}
|
|
198
|
+
REGISTERED_PLUGIN_KEYS.clear();
|
|
199
|
+
}
|
|
144
200
|
|
|
145
201
|
// src/registry/index.ts
|
|
146
202
|
function getRegistryEntry(name) {
|
|
147
|
-
|
|
203
|
+
if (Object.prototype.hasOwnProperty.call(BASE_STYLE_REGISTRY, name)) {
|
|
204
|
+
return BASE_STYLE_REGISTRY[name];
|
|
205
|
+
}
|
|
206
|
+
return void 0;
|
|
207
|
+
}
|
|
208
|
+
function getRegistryEntryAny(name) {
|
|
209
|
+
const merged = getMergedStyleRegistry();
|
|
210
|
+
return merged[name];
|
|
148
211
|
}
|
|
149
212
|
function isKnownStyleName(name) {
|
|
150
|
-
return Object.prototype.hasOwnProperty.call(
|
|
213
|
+
return Object.prototype.hasOwnProperty.call(BASE_STYLE_REGISTRY, name);
|
|
214
|
+
}
|
|
215
|
+
function isRegisteredStyleName(name) {
|
|
216
|
+
if (Object.prototype.hasOwnProperty.call(BASE_STYLE_REGISTRY, name)) {
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
return Object.prototype.hasOwnProperty.call(getPluginStyleRegistry(), name);
|
|
220
|
+
}
|
|
221
|
+
function getStylePluginId(name) {
|
|
222
|
+
const plugin = getPluginStyleRegistry()[name];
|
|
223
|
+
return plugin?.pluginId;
|
|
151
224
|
}
|
|
152
225
|
|
|
153
226
|
// src/api/endpoints.ts
|
|
@@ -646,11 +719,12 @@ function toBool(value) {
|
|
|
646
719
|
}
|
|
647
720
|
function transformPageData(apiPage) {
|
|
648
721
|
const id = apiPage.id ?? apiPage.id_pages ?? 0;
|
|
722
|
+
const parentPageId = apiPage.parent_page_id ?? apiPage.id_parent_page ?? null;
|
|
649
723
|
return {
|
|
650
724
|
id,
|
|
651
725
|
keyword: apiPage.keyword ?? "",
|
|
652
726
|
url: apiPage.url ?? null,
|
|
653
|
-
parent_page_id:
|
|
727
|
+
parent_page_id: parentPageId,
|
|
654
728
|
is_headless: toBool(apiPage.is_headless),
|
|
655
729
|
navPosition: apiPage.navPosition !== void 0 ? apiPage.navPosition : apiPage.nav_position ?? null,
|
|
656
730
|
footerPosition: apiPage.footerPosition !== void 0 ? apiPage.footerPosition : apiPage.footer_position ?? null,
|
|
@@ -664,8 +738,8 @@ function transformPageData(apiPage) {
|
|
|
664
738
|
acl_insert: apiPage.acl_insert,
|
|
665
739
|
acl_update: apiPage.acl_update,
|
|
666
740
|
acl_delete: apiPage.acl_delete,
|
|
667
|
-
|
|
668
|
-
|
|
741
|
+
id_page_types: apiPage.id_page_types,
|
|
742
|
+
id_page_access_types: apiPage.id_page_access_types
|
|
669
743
|
};
|
|
670
744
|
}
|
|
671
745
|
function transformPagesData(pages) {
|
|
@@ -674,6 +748,7 @@ function transformPagesData(pages) {
|
|
|
674
748
|
}
|
|
675
749
|
export {
|
|
676
750
|
API_VERSION_PREFIX,
|
|
751
|
+
BASE_STYLE_REGISTRY,
|
|
677
752
|
CLASS_PATTERNS,
|
|
678
753
|
CLASS_REMAP,
|
|
679
754
|
CLIENT_TYPE_MOBILE,
|
|
@@ -695,14 +770,21 @@ export {
|
|
|
695
770
|
SPACING_TO_TAILWIND,
|
|
696
771
|
SPACING_VALUES,
|
|
697
772
|
STYLE_REGISTRY,
|
|
773
|
+
_resetPluginStyleRegistry,
|
|
698
774
|
buildConditionContext,
|
|
699
775
|
classifyClass,
|
|
700
776
|
classifyClassString,
|
|
701
777
|
colorToHex,
|
|
702
778
|
evaluateCondition,
|
|
779
|
+
extendStyleRegistry,
|
|
703
780
|
findRemap,
|
|
781
|
+
getMergedStyleRegistry,
|
|
782
|
+
getPluginStyleRegistry,
|
|
704
783
|
getRegistryEntry,
|
|
784
|
+
getRegistryEntryAny,
|
|
785
|
+
getStylePluginId,
|
|
705
786
|
isKnownStyleName,
|
|
787
|
+
isRegisteredStyleName,
|
|
706
788
|
parseSpacing,
|
|
707
789
|
radiusToPx,
|
|
708
790
|
replaceCalcedValues,
|