@selfhelp/shared 1.16.0 → 1.17.1
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 +37 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/plugin-sdk/index.d.mts +29 -2
- package/dist/plugin-sdk/index.d.ts +29 -2
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/index.mjs +1 -1
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.d.ts +2 -2
- package/dist/{styles.registry-4W0LzmZB.d.mts → styles.registry-6UBNKpyL.d.mts} +11 -0
- package/dist/{styles.registry-D6xMm5VR.d.ts → styles.registry-CANYbEa5.d.ts} +11 -0
- package/package.json +1 -1
- package/src/plugin-sdk/__tests__/host-services.test.ts +31 -5
- package/src/plugin-sdk/host-services.ts +21 -0
- package/src/plugin-sdk/version.ts +7 -1
- package/src/types/styles/forms.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,43 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
|
|
|
9
9
|
|
|
10
10
|
This project follows semantic versioning.
|
|
11
11
|
|
|
12
|
+
## v1.17.1
|
|
13
|
+
|
|
14
|
+
**`IShowUserInputStyle.field_labels`** — adds the optional header map
|
|
15
|
+
`field_key => display_name` the backend now sends with `show-user-input` entries
|
|
16
|
+
(host issue #56 v2). Rows are keyed by the immutable data-column `field_key`, so
|
|
17
|
+
the renderer reads `field_labels` to show the human column label in the table
|
|
18
|
+
header; renaming a column relabels the header automatically, and `fields_map`
|
|
19
|
+
stays an explicit override. Additive only — the field is optional, so `^1.x`
|
|
20
|
+
consumers and older hosts (which omit it) fall back to the raw key and are
|
|
21
|
+
unaffected.
|
|
22
|
+
|
|
23
|
+
### Added (additive, non-breaking)
|
|
24
|
+
|
|
25
|
+
- **`IShowUserInputStyle.field_labels?: Record<string, string>`** — `field_key`
|
|
26
|
+
to `display_name` map for `show-user-input` headers (issue #56 v2).
|
|
27
|
+
|
|
28
|
+
## v1.17.0
|
|
29
|
+
|
|
30
|
+
**Mobile host-navigation capability** — adds the optional
|
|
31
|
+
`IMobileHostServices.navigate(target, external?)` so a plugin's mobile package can
|
|
32
|
+
honour an in-content redirect (e.g. a survey's "redirect on completion") through
|
|
33
|
+
the host router instead of touching `window.location`. The host owns the router,
|
|
34
|
+
so it routes an internal CMS page keyword / in-app path through its own navigation
|
|
35
|
+
stack and only leaves the app for an explicit external URL — keeping redirects
|
|
36
|
+
correct in BOTH the native app and the CMS web preview iframe (where a raw
|
|
37
|
+
`location` assignment navigates and breaks the embedded frame). Additive only —
|
|
38
|
+
the method is optional, so `^1.x` consumers and older hosts/plugins are unaffected.
|
|
39
|
+
|
|
40
|
+
### Added (additive, non-breaking)
|
|
41
|
+
|
|
42
|
+
- **`IMobileHostServices.navigate?(target, external?)`** — optional host-owned
|
|
43
|
+
navigation; a plugin MUST feature-detect (`if (host.navigate)`) and degrade
|
|
44
|
+
gracefully on an older host.
|
|
45
|
+
- **`MOBILE_RENDERER_VERSION`** bumped `0.2.0 -> 0.3.0` (additive renderer
|
|
46
|
+
feature). Plugins that need host navigation declare `compatibility.mobile`
|
|
47
|
+
including `0.3.0`; they gate against it through `isMobileRendererCompatible`.
|
|
48
|
+
|
|
12
49
|
## v1.16.0
|
|
13
50
|
|
|
14
51
|
**Mobile host-services bridge** — a typed contract so a plugin's mobile package
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-
|
|
1
|
+
import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-6UBNKpyL.mjs';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-6UBNKpyL.mjs';
|
|
3
3
|
export { v as TMantineAccordionVariant, y as TMantineActionIconLoading, d as TMantineAlign, z as TMantineAllowNextClicks, A as TMantineAllowStepClick, B as TMantineAspectRatio, C as TMantineAutoContrast, r as TMantineAvatarVariant, q as TMantineBadgeVariant, D as TMantineBlock, E as TMantineCenterInline, F as TMantineChecked, G as TMantineChipChecked, H as TMantineChipMultiple, s as TMantineChipVariant, I as TMantineClampBehavior, J as TMantineCodeBlock, T as TMantineColor, K as TMantineColorFormat, L as TMantineColorInputSwatches, M as TMantineColorPickerSwatches, N as TMantineColorPickerSwatchesPerRow, O as TMantineCompact, P as TMantineContainerFluid, e as TMantineDirection, Q as TMantineDisabled, n as TMantineFieldsetVariant, R as TMantineFileAccept, S as TMantineFileInputMultiple, U as TMantineFluid, V as TMantineFullWidth, i as TMantineGridGrow, g as TMantineGridOverflow, h as TMantineGridSpan, W as TMantineGroupGrow, X as TMantineGroupWrap, Y as TMantineGrow, Z as TMantineHighlight, t as TMantineIndicatorPosition, _ as TMantineInline, $ as TMantineIsLink, c as TMantineJustify, a0 as TMantineKbdSize, a1 as TMantineLoading, a2 as TMantineMultiple, a3 as TMantineNotificationWithCloseButton, a4 as TMantineNumberInputDecimalScale, a5 as TMantineOpenInNewTab, j as TMantineOrientation, a6 as TMantineProcessing, a as TMantineRadius, a7 as TMantineRangeSliderMarks, a8 as TMantineRatingCount, a9 as TMantineRatingFractions, aa as TMantineRatingReadonly, ab as TMantineReadonly, m as TMantineSize, ac as TMantineSpaceHorizontal, ad as TMantineSpacing, o as TMantineSpoilerMaxHeight, ae as TMantineSwatches, af as TMantineTabDisabled, w as TMantineTabsVariant, u as TMantineThemeIconVariant, x as TMantineTimelineLineVariant, l as TMantineTitleOrder, ag as TMantineUseMantineStyle, p as TMantineVariant, ah as TMantineWithCloseButton, ai as TMantineWithIcon, f as TMantineWrap, k as TSharedRadius, b as TSharedSize } from './common-qaDIAYS3.mjs';
|
|
4
4
|
import { ReactNode, ComponentType } from 'react';
|
|
5
5
|
import { THeroUiButtonVariant, THeroUiSize } from './theme/index.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-
|
|
2
|
-
export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-
|
|
1
|
+
import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-CANYbEa5.js';
|
|
2
|
+
export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-CANYbEa5.js';
|
|
3
3
|
export { v as TMantineAccordionVariant, y as TMantineActionIconLoading, d as TMantineAlign, z as TMantineAllowNextClicks, A as TMantineAllowStepClick, B as TMantineAspectRatio, C as TMantineAutoContrast, r as TMantineAvatarVariant, q as TMantineBadgeVariant, D as TMantineBlock, E as TMantineCenterInline, F as TMantineChecked, G as TMantineChipChecked, H as TMantineChipMultiple, s as TMantineChipVariant, I as TMantineClampBehavior, J as TMantineCodeBlock, T as TMantineColor, K as TMantineColorFormat, L as TMantineColorInputSwatches, M as TMantineColorPickerSwatches, N as TMantineColorPickerSwatchesPerRow, O as TMantineCompact, P as TMantineContainerFluid, e as TMantineDirection, Q as TMantineDisabled, n as TMantineFieldsetVariant, R as TMantineFileAccept, S as TMantineFileInputMultiple, U as TMantineFluid, V as TMantineFullWidth, i as TMantineGridGrow, g as TMantineGridOverflow, h as TMantineGridSpan, W as TMantineGroupGrow, X as TMantineGroupWrap, Y as TMantineGrow, Z as TMantineHighlight, t as TMantineIndicatorPosition, _ as TMantineInline, $ as TMantineIsLink, c as TMantineJustify, a0 as TMantineKbdSize, a1 as TMantineLoading, a2 as TMantineMultiple, a3 as TMantineNotificationWithCloseButton, a4 as TMantineNumberInputDecimalScale, a5 as TMantineOpenInNewTab, j as TMantineOrientation, a6 as TMantineProcessing, a as TMantineRadius, a7 as TMantineRangeSliderMarks, a8 as TMantineRatingCount, a9 as TMantineRatingFractions, aa as TMantineRatingReadonly, ab as TMantineReadonly, m as TMantineSize, ac as TMantineSpaceHorizontal, ad as TMantineSpacing, o as TMantineSpoilerMaxHeight, ae as TMantineSwatches, af as TMantineTabDisabled, w as TMantineTabsVariant, u as TMantineThemeIconVariant, x as TMantineTimelineLineVariant, l as TMantineTitleOrder, ag as TMantineUseMantineStyle, p as TMantineVariant, ah as TMantineWithCloseButton, ai as TMantineWithIcon, f as TMantineWrap, k as TSharedRadius, b as TSharedSize } from './common-qaDIAYS3.js';
|
|
4
4
|
import { ReactNode, ComponentType } from 'react';
|
|
5
5
|
import { THeroUiButtonVariant, THeroUiSize } from './theme/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
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-8YXAk-4o.mjs';
|
|
2
|
-
import { I as IStyleRegistryEntry } from '../styles.registry-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-6UBNKpyL.mjs';
|
|
3
3
|
import '../common-qaDIAYS3.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -35,8 +35,14 @@ declare const PLUGIN_API_VERSION: "0.1.0";
|
|
|
35
35
|
* `set/getMobileHostServices`) so a plugin's mobile package routes protected
|
|
36
36
|
* API calls through the native host (token + 401-refresh owned host-side)
|
|
37
37
|
* instead of injecting raw tokens — an additive renderer feature.
|
|
38
|
+
*
|
|
39
|
+
* `0.3.0` adds the optional `IMobileHostServices.navigate(target, external)`
|
|
40
|
+
* host-navigation capability so a plugin can honour an in-content redirect
|
|
41
|
+
* through the host router (correct in the native app AND the CMS web preview
|
|
42
|
+
* iframe) instead of touching `window.location` — an additive renderer feature.
|
|
43
|
+
* It is optional, so older plugins/hosts stay compatible.
|
|
38
44
|
*/
|
|
39
|
-
declare const MOBILE_RENDERER_VERSION: "0.
|
|
45
|
+
declare const MOBILE_RENDERER_VERSION: "0.3.0";
|
|
40
46
|
interface ISemver {
|
|
41
47
|
major: number;
|
|
42
48
|
minor: number;
|
|
@@ -783,6 +789,27 @@ interface IMobileHostServices {
|
|
|
783
789
|
getAccessToken(): string | null;
|
|
784
790
|
/** Perform an authenticated request with host-managed 401 refresh. */
|
|
785
791
|
request<TData = unknown>(req: IMobileHostRequest): Promise<IMobileHostResponse<TData>>;
|
|
792
|
+
/**
|
|
793
|
+
* Navigate the host app on the user's behalf to honour an in-content
|
|
794
|
+
* redirect (e.g. a survey's "redirect on completion") WITHOUT the plugin
|
|
795
|
+
* touching `window.location`. The host owns the router, so it routes an
|
|
796
|
+
* internal CMS page keyword / in-app path through its own navigation stack
|
|
797
|
+
* and only leaves the app for an explicit external URL. This keeps redirects
|
|
798
|
+
* correct in EVERY host surface — the native app AND the CMS web preview,
|
|
799
|
+
* where a raw `location` assignment would navigate (and break) the embedded
|
|
800
|
+
* iframe instead of the app.
|
|
801
|
+
*
|
|
802
|
+
* @param target CMS page keyword / in-app path, or an absolute URL when
|
|
803
|
+
* `external` is true.
|
|
804
|
+
* @param external When true the target is a full off-app URL the host opens
|
|
805
|
+
* in the system browser (native) / a new tab (web) instead of
|
|
806
|
+
* routing inside the app. Defaults to false.
|
|
807
|
+
*
|
|
808
|
+
* Optional: a host registered by an older app binary (renderer < 0.3.0) may
|
|
809
|
+
* omit it, so a plugin MUST feature-detect (`if (host.navigate)`) and degrade
|
|
810
|
+
* gracefully rather than assume it exists.
|
|
811
|
+
*/
|
|
812
|
+
navigate?(target: string, external?: boolean): void;
|
|
786
813
|
}
|
|
787
814
|
/**
|
|
788
815
|
* Register the host services implementation. Called once by the native
|
|
@@ -1,5 +1,5 @@
|
|
|
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-8YXAk-4o.js';
|
|
2
|
-
import { I as IStyleRegistryEntry } from '../styles.registry-
|
|
2
|
+
import { I as IStyleRegistryEntry } from '../styles.registry-CANYbEa5.js';
|
|
3
3
|
import '../common-qaDIAYS3.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -35,8 +35,14 @@ declare const PLUGIN_API_VERSION: "0.1.0";
|
|
|
35
35
|
* `set/getMobileHostServices`) so a plugin's mobile package routes protected
|
|
36
36
|
* API calls through the native host (token + 401-refresh owned host-side)
|
|
37
37
|
* instead of injecting raw tokens — an additive renderer feature.
|
|
38
|
+
*
|
|
39
|
+
* `0.3.0` adds the optional `IMobileHostServices.navigate(target, external)`
|
|
40
|
+
* host-navigation capability so a plugin can honour an in-content redirect
|
|
41
|
+
* through the host router (correct in the native app AND the CMS web preview
|
|
42
|
+
* iframe) instead of touching `window.location` — an additive renderer feature.
|
|
43
|
+
* It is optional, so older plugins/hosts stay compatible.
|
|
38
44
|
*/
|
|
39
|
-
declare const MOBILE_RENDERER_VERSION: "0.
|
|
45
|
+
declare const MOBILE_RENDERER_VERSION: "0.3.0";
|
|
40
46
|
interface ISemver {
|
|
41
47
|
major: number;
|
|
42
48
|
minor: number;
|
|
@@ -783,6 +789,27 @@ interface IMobileHostServices {
|
|
|
783
789
|
getAccessToken(): string | null;
|
|
784
790
|
/** Perform an authenticated request with host-managed 401 refresh. */
|
|
785
791
|
request<TData = unknown>(req: IMobileHostRequest): Promise<IMobileHostResponse<TData>>;
|
|
792
|
+
/**
|
|
793
|
+
* Navigate the host app on the user's behalf to honour an in-content
|
|
794
|
+
* redirect (e.g. a survey's "redirect on completion") WITHOUT the plugin
|
|
795
|
+
* touching `window.location`. The host owns the router, so it routes an
|
|
796
|
+
* internal CMS page keyword / in-app path through its own navigation stack
|
|
797
|
+
* and only leaves the app for an explicit external URL. This keeps redirects
|
|
798
|
+
* correct in EVERY host surface — the native app AND the CMS web preview,
|
|
799
|
+
* where a raw `location` assignment would navigate (and break) the embedded
|
|
800
|
+
* iframe instead of the app.
|
|
801
|
+
*
|
|
802
|
+
* @param target CMS page keyword / in-app path, or an absolute URL when
|
|
803
|
+
* `external` is true.
|
|
804
|
+
* @param external When true the target is a full off-app URL the host opens
|
|
805
|
+
* in the system browser (native) / a new tab (web) instead of
|
|
806
|
+
* routing inside the app. Defaults to false.
|
|
807
|
+
*
|
|
808
|
+
* Optional: a host registered by an older app binary (renderer < 0.3.0) may
|
|
809
|
+
* omit it, so a plugin MUST feature-detect (`if (host.navigate)`) and degrade
|
|
810
|
+
* gracefully rather than assume it exists.
|
|
811
|
+
*/
|
|
812
|
+
navigate?(target: string, external?: boolean): void;
|
|
786
813
|
}
|
|
787
814
|
/**
|
|
788
815
|
* Register the host services implementation. Called once by the native
|
package/dist/plugin-sdk/index.js
CHANGED
|
@@ -48,7 +48,7 @@ module.exports = __toCommonJS(plugin_sdk_exports);
|
|
|
48
48
|
|
|
49
49
|
// src/plugin-sdk/version.ts
|
|
50
50
|
var PLUGIN_API_VERSION = "0.1.0";
|
|
51
|
-
var MOBILE_RENDERER_VERSION = "0.
|
|
51
|
+
var MOBILE_RENDERER_VERSION = "0.3.0";
|
|
52
52
|
var SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;
|
|
53
53
|
function parseSemver(version) {
|
|
54
54
|
const match = SEMVER_REGEX.exec(version);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/plugin-sdk/version.ts
|
|
2
2
|
var PLUGIN_API_VERSION = "0.1.0";
|
|
3
|
-
var MOBILE_RENDERER_VERSION = "0.
|
|
3
|
+
var MOBILE_RENDERER_VERSION = "0.3.0";
|
|
4
4
|
var SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;
|
|
5
5
|
function parseSemver(version) {
|
|
6
6
|
const match = SEMVER_REGEX.exec(version);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-
|
|
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-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-6UBNKpyL.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-6UBNKpyL.mjs';
|
|
3
3
|
import '../common-qaDIAYS3.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-
|
|
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-
|
|
1
|
+
import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-CANYbEa5.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-CANYbEa5.js';
|
|
3
3
|
import '../common-qaDIAYS3.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1113,7 +1113,18 @@ interface IShowUserInputStyle extends IBaseStyle {
|
|
|
1113
1113
|
web_table_with_row_borders?: IContentField<string>;
|
|
1114
1114
|
web_table_sticky_header?: IContentField<string>;
|
|
1115
1115
|
web_table_caption_side?: IContentField<string>;
|
|
1116
|
+
/**
|
|
1117
|
+
* show-user-input rows, each keyed by the immutable data-column `field_key`
|
|
1118
|
+
* (issue #56 v2). Header labels come from {@link field_labels}, not the keys.
|
|
1119
|
+
*/
|
|
1116
1120
|
entries?: IShowUserInputEntry[];
|
|
1121
|
+
/**
|
|
1122
|
+
* Header map `field_key => display_name` for {@link entries} (issue #56 v2).
|
|
1123
|
+
* Lets the table show the human column label while rows stay keyed by the
|
|
1124
|
+
* stable `field_key`, so renaming a column relabels the header automatically.
|
|
1125
|
+
* `fields_map` still overrides individual headers when set.
|
|
1126
|
+
*/
|
|
1127
|
+
field_labels?: Record<string, string>;
|
|
1117
1128
|
}
|
|
1118
1129
|
|
|
1119
1130
|
type TMantineAccordionMultiple = '0' | '1';
|
|
@@ -1113,7 +1113,18 @@ interface IShowUserInputStyle extends IBaseStyle {
|
|
|
1113
1113
|
web_table_with_row_borders?: IContentField<string>;
|
|
1114
1114
|
web_table_sticky_header?: IContentField<string>;
|
|
1115
1115
|
web_table_caption_side?: IContentField<string>;
|
|
1116
|
+
/**
|
|
1117
|
+
* show-user-input rows, each keyed by the immutable data-column `field_key`
|
|
1118
|
+
* (issue #56 v2). Header labels come from {@link field_labels}, not the keys.
|
|
1119
|
+
*/
|
|
1116
1120
|
entries?: IShowUserInputEntry[];
|
|
1121
|
+
/**
|
|
1122
|
+
* Header map `field_key => display_name` for {@link entries} (issue #56 v2).
|
|
1123
|
+
* Lets the table show the human column label while rows stay keyed by the
|
|
1124
|
+
* stable `field_key`, so renaming a column relabels the header automatically.
|
|
1125
|
+
* `fields_map` still overrides individual headers when set.
|
|
1126
|
+
*/
|
|
1127
|
+
field_labels?: Record<string, string>;
|
|
1117
1128
|
}
|
|
1118
1129
|
|
|
1119
1130
|
type TMantineAccordionMultiple = '0' | '1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.1",
|
|
4
4
|
"description": "Shared TypeScript package for SelfHelp web frontend and mobile app: style registry, types, API contracts, Mantine theme tokens, condition + interpolation engines, CMS class allow-list.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -3,7 +3,7 @@ SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
|
3
3
|
SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* Mobile host-services bridge contract (mobile renderer axis 0.
|
|
6
|
+
* Mobile host-services bridge contract (mobile renderer axis 0.3.0).
|
|
7
7
|
*
|
|
8
8
|
* The shared package only owns the *contract* + the singleton registry; the
|
|
9
9
|
* real 401-refresh / session-expired logic lives in the native host's
|
|
@@ -14,7 +14,9 @@ SPDX-License-Identifier: MPL-2.0
|
|
|
14
14
|
* plugin branch on lifecycle + refresh outcomes through a representative
|
|
15
15
|
* fake host that performs a single 401 -> refresh -> retry, and reports
|
|
16
16
|
* session-expired when the refresh itself fails,
|
|
17
|
-
* - `isMobileRendererCompatible` covers the bumped 0.
|
|
17
|
+
* - `isMobileRendererCompatible` covers the bumped 0.3.0 host,
|
|
18
|
+
* - the host may expose the optional `navigate()` capability a plugin
|
|
19
|
+
* feature-detects to honour an in-content redirect through the host router.
|
|
18
20
|
*/
|
|
19
21
|
|
|
20
22
|
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
@@ -57,6 +59,29 @@ describe('mobile host-services singleton', () => {
|
|
|
57
59
|
setMobileHostServices(null);
|
|
58
60
|
expect(getMobileHostServices()).toBeNull();
|
|
59
61
|
});
|
|
62
|
+
|
|
63
|
+
it('exposes the optional navigate() a renderer-0.3.0 host registers', () => {
|
|
64
|
+
const navigate = vi.fn();
|
|
65
|
+
setMobileHostServices({
|
|
66
|
+
apiBaseUrl: () => 'https://cms.example.com',
|
|
67
|
+
getAccessToken: () => null,
|
|
68
|
+
request: () => Promise.resolve({ ok: true, status: 200, data: null }),
|
|
69
|
+
navigate,
|
|
70
|
+
});
|
|
71
|
+
const host = getMobileHostServices();
|
|
72
|
+
expect(typeof host?.navigate).toBe('function');
|
|
73
|
+
host?.navigate?.('contact', false);
|
|
74
|
+
expect(navigate).toHaveBeenCalledWith('contact', false);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('omits navigate on an older host so a plugin must feature-detect it', () => {
|
|
78
|
+
setMobileHostServices({
|
|
79
|
+
apiBaseUrl: () => 'https://cms.example.com',
|
|
80
|
+
getAccessToken: () => null,
|
|
81
|
+
request: () => Promise.resolve({ ok: true, status: 200, data: null }),
|
|
82
|
+
});
|
|
83
|
+
expect(getMobileHostServices()?.navigate).toBeUndefined();
|
|
84
|
+
});
|
|
60
85
|
});
|
|
61
86
|
|
|
62
87
|
describe('host request contract (host owns token + refresh)', () => {
|
|
@@ -128,9 +153,10 @@ describe('host request contract (host owns token + refresh)', () => {
|
|
|
128
153
|
});
|
|
129
154
|
|
|
130
155
|
describe('mobile renderer compatibility at the bumped version', () => {
|
|
131
|
-
it('advertises 0.
|
|
132
|
-
expect(MOBILE_RENDERER_VERSION).toBe('0.
|
|
133
|
-
expect(isMobileRendererCompatible('^0.
|
|
156
|
+
it('advertises 0.3.0 and gates plugin compatibility.mobile ranges against it', () => {
|
|
157
|
+
expect(MOBILE_RENDERER_VERSION).toBe('0.3.0');
|
|
158
|
+
expect(isMobileRendererCompatible('^0.3.0')).toBe(true);
|
|
159
|
+
expect(isMobileRendererCompatible('>=0.2.0')).toBe(true);
|
|
134
160
|
expect(isMobileRendererCompatible('^0.1.0')).toBe(false);
|
|
135
161
|
});
|
|
136
162
|
});
|
|
@@ -92,6 +92,27 @@ export interface IMobileHostServices {
|
|
|
92
92
|
getAccessToken(): string | null;
|
|
93
93
|
/** Perform an authenticated request with host-managed 401 refresh. */
|
|
94
94
|
request<TData = unknown>(req: IMobileHostRequest): Promise<IMobileHostResponse<TData>>;
|
|
95
|
+
/**
|
|
96
|
+
* Navigate the host app on the user's behalf to honour an in-content
|
|
97
|
+
* redirect (e.g. a survey's "redirect on completion") WITHOUT the plugin
|
|
98
|
+
* touching `window.location`. The host owns the router, so it routes an
|
|
99
|
+
* internal CMS page keyword / in-app path through its own navigation stack
|
|
100
|
+
* and only leaves the app for an explicit external URL. This keeps redirects
|
|
101
|
+
* correct in EVERY host surface — the native app AND the CMS web preview,
|
|
102
|
+
* where a raw `location` assignment would navigate (and break) the embedded
|
|
103
|
+
* iframe instead of the app.
|
|
104
|
+
*
|
|
105
|
+
* @param target CMS page keyword / in-app path, or an absolute URL when
|
|
106
|
+
* `external` is true.
|
|
107
|
+
* @param external When true the target is a full off-app URL the host opens
|
|
108
|
+
* in the system browser (native) / a new tab (web) instead of
|
|
109
|
+
* routing inside the app. Defaults to false.
|
|
110
|
+
*
|
|
111
|
+
* Optional: a host registered by an older app binary (renderer < 0.3.0) may
|
|
112
|
+
* omit it, so a plugin MUST feature-detect (`if (host.navigate)`) and degrade
|
|
113
|
+
* gracefully rather than assume it exists.
|
|
114
|
+
*/
|
|
115
|
+
navigate?(target: string, external?: boolean): void;
|
|
95
116
|
}
|
|
96
117
|
|
|
97
118
|
let registeredHostServices: IMobileHostServices | null = null;
|
|
@@ -36,8 +36,14 @@ export const PLUGIN_API_VERSION = '0.1.0' as const;
|
|
|
36
36
|
* `set/getMobileHostServices`) so a plugin's mobile package routes protected
|
|
37
37
|
* API calls through the native host (token + 401-refresh owned host-side)
|
|
38
38
|
* instead of injecting raw tokens — an additive renderer feature.
|
|
39
|
+
*
|
|
40
|
+
* `0.3.0` adds the optional `IMobileHostServices.navigate(target, external)`
|
|
41
|
+
* host-navigation capability so a plugin can honour an in-content redirect
|
|
42
|
+
* through the host router (correct in the native app AND the CMS web preview
|
|
43
|
+
* iframe) instead of touching `window.location` — an additive renderer feature.
|
|
44
|
+
* It is optional, so older plugins/hosts stay compatible.
|
|
39
45
|
*/
|
|
40
|
-
export const MOBILE_RENDERER_VERSION = '0.
|
|
46
|
+
export const MOBILE_RENDERER_VERSION = '0.3.0' as const;
|
|
41
47
|
|
|
42
48
|
export interface ISemver {
|
|
43
49
|
major: number;
|
|
@@ -498,5 +498,16 @@ export interface IShowUserInputStyle extends IBaseStyle {
|
|
|
498
498
|
web_table_with_row_borders?: IContentField<string>;
|
|
499
499
|
web_table_sticky_header?: IContentField<string>;
|
|
500
500
|
web_table_caption_side?: IContentField<string>;
|
|
501
|
+
/**
|
|
502
|
+
* show-user-input rows, each keyed by the immutable data-column `field_key`
|
|
503
|
+
* (issue #56 v2). Header labels come from {@link field_labels}, not the keys.
|
|
504
|
+
*/
|
|
501
505
|
entries?: IShowUserInputEntry[];
|
|
506
|
+
/**
|
|
507
|
+
* Header map `field_key => display_name` for {@link entries} (issue #56 v2).
|
|
508
|
+
* Lets the table show the human column label while rows stay keyed by the
|
|
509
|
+
* stable `field_key`, so renaming a column relabels the header automatically.
|
|
510
|
+
* `fields_map` still overrides individual headers when set.
|
|
511
|
+
*/
|
|
512
|
+
field_labels?: Record<string, string>;
|
|
502
513
|
}
|