@zachariaz/strapi-plugin-experience-context 0.0.0-stage → 0.1.0-dev.2
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/LICENSE +21 -0
- package/README.md +86 -2
- package/dist/_chunks/en-8ms9Hfxr.mjs +27 -0
- package/dist/_chunks/en-yERKDiB0.js +27 -0
- package/dist/admin/index.js +464 -0
- package/dist/admin/index.mjs +448 -0
- package/dist/admin/src/api/client.d.ts +13 -0
- package/dist/admin/src/api/types.d.ts +93 -0
- package/dist/admin/src/api/useInspect.d.ts +3 -0
- package/dist/admin/src/components/BlockMarkers.d.ts +12 -0
- package/dist/admin/src/components/ExperienceModal.d.ts +28 -0
- package/dist/admin/src/components/HeaderBadge.d.ts +19 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/ModalTrigger.d.ts +10 -0
- package/dist/admin/src/contentManagerHooks/editView.d.ts +7 -0
- package/dist/admin/src/index.d.ts +17 -0
- package/dist/admin/src/pluginId.d.ts +2 -0
- package/dist/admin/src/utils/dzSlots.d.ts +16 -0
- package/dist/admin/src/utils/labels.d.ts +30 -0
- package/dist/admin/src/utils/markers.d.ts +12 -0
- package/dist/admin/src/utils/modal.d.ts +10 -0
- package/dist/admin/src/utils/targets.d.ts +12 -0
- package/dist/server/index.js +3780 -0
- package/dist/server/index.mjs +3781 -0
- package/dist/server/src/admin-api/access.d.ts +40 -0
- package/dist/server/src/admin-api/inspect.d.ts +132 -0
- package/dist/server/src/admin-api/mark.d.ts +9 -0
- package/dist/server/src/block-keys/index.d.ts +16 -0
- package/dist/server/src/block-keys/middleware.d.ts +17 -0
- package/dist/server/src/block-keys/stamp.d.ts +55 -0
- package/dist/server/src/block-keys/store.d.ts +33 -0
- package/dist/server/src/block-keys/targets.d.ts +43 -0
- package/dist/server/src/bootstrap.d.ts +16 -0
- package/dist/server/src/changes.d.ts +80 -0
- package/dist/server/src/config/index.d.ts +67 -0
- package/dist/server/src/constants.d.ts +18 -0
- package/dist/server/src/content-types/index.d.ts +309 -0
- package/dist/server/src/controllers/admin.d.ts +10 -0
- package/dist/server/src/controllers/experience.d.ts +15 -0
- package/dist/server/src/controllers/index.d.ts +16 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +441 -0
- package/dist/server/src/integrity/index.d.ts +34 -0
- package/dist/server/src/integrity/orphans.d.ts +40 -0
- package/dist/server/src/mcp/index.d.ts +2 -0
- package/dist/server/src/mcp/operations.d.ts +815 -0
- package/dist/server/src/mcp/permissions.d.ts +56 -0
- package/dist/server/src/mcp/tools.d.ts +59 -0
- package/dist/server/src/model/content.d.ts +32 -0
- package/dist/server/src/model/mapping.d.ts +90 -0
- package/dist/server/src/model/records.d.ts +132 -0
- package/dist/server/src/model/store.d.ts +44 -0
- package/dist/server/src/model/target.d.ts +40 -0
- package/dist/server/src/policies/index.d.ts +4 -0
- package/dist/server/src/rbac/index.d.ts +24 -0
- package/dist/server/src/read-path/editor.d.ts +28 -0
- package/dist/server/src/read-path/gate.d.ts +26 -0
- package/dist/server/src/read-path/index.d.ts +12 -0
- package/dist/server/src/read-path/loader.d.ts +31 -0
- package/dist/server/src/read-path/middleware.d.ts +32 -0
- package/dist/server/src/read-path/payload.d.ts +34 -0
- package/dist/server/src/read-path/populate.d.ts +6 -0
- package/dist/server/src/register.d.ts +14 -0
- package/dist/server/src/registry/index.d.ts +29 -0
- package/dist/server/src/registry/unomi.d.ts +53 -0
- package/dist/server/src/routes/index.d.ts +25 -0
- package/dist/server/src/services/index.d.ts +79 -0
- package/package.json +140 -4
- package/scripts/experience-smoke.mjs +430 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM helpers that place a marker in the header of each dynamic-zone block.
|
|
3
|
+
*
|
|
4
|
+
* The Content Manager offers no hook for a block's accordion header (its
|
|
5
|
+
* title is a plain string), so the markers are React portals into a small
|
|
6
|
+
* container we add next to each header's trigger button. The containers are
|
|
7
|
+
* found again by attribute on every render and recreated when the Content
|
|
8
|
+
* Manager re-renders a header (drag and drop), so stale ones are harmless.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SLOT_ATTR = "data-experience-context-marker";
|
|
11
|
+
/** The `<ol>` of the dynamic zone whose label contains `anchor`. */
|
|
12
|
+
export declare function findZoneList(anchor: Element | null): HTMLOListElement | null;
|
|
13
|
+
/** The marker container in block `li`'s header, created when missing. `null` while the block is being dragged. */
|
|
14
|
+
export declare function slotFor(li: Element): HTMLElement | null;
|
|
15
|
+
/** One container per block, in DOM order (= form order). */
|
|
16
|
+
export declare function zoneSlots(anchor: Element | null): Array<HTMLElement | null>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BlockCard, InspectSummary } from '../api/types';
|
|
2
|
+
/**
|
|
3
|
+
* Plain-English labels (English only for now). Terminology per plan §1.4:
|
|
4
|
+
* sections, variations, experiment outcomes, concepts; never "rules" or
|
|
5
|
+
* "facts". They are default messages; the translation keys live next to
|
|
6
|
+
* their call sites.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hasAnything: (s: InspectSummary | null | undefined) => s is InspectSummary;
|
|
9
|
+
/** The ICU message of one part of the header button, with its values. */
|
|
10
|
+
export interface HeaderPart {
|
|
11
|
+
id: string;
|
|
12
|
+
defaultMessage: string;
|
|
13
|
+
values: Record<string, string | number>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The edit-view header button, after "Experience": "2 sections", "3
|
|
17
|
+
* variations", "1 experiment running", "4 concepts", "1 orphaned",
|
|
18
|
+
* "1 validation error". Message descriptors, so the button and the tests
|
|
19
|
+
* format them with the same catalog.
|
|
20
|
+
*/
|
|
21
|
+
export declare function headerParts(s: InspectSummary, pluginId: string): HeaderPart[];
|
|
22
|
+
/** Short marker text for a block in the dynamic zone. */
|
|
23
|
+
export declare function markerText(card: BlockCard): string;
|
|
24
|
+
/** Tooltip/aria text of a block marker. */
|
|
25
|
+
export declare function markerLabel(card: BlockCard): string;
|
|
26
|
+
/** The rows of one card, in the order of plan §7.1 (label, text). */
|
|
27
|
+
export declare function cardRows(card: BlockCard): Array<{
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BlockCard } from '../api/types';
|
|
2
|
+
/**
|
|
3
|
+
* Which dynamic-zone positions get a marker: the card for each block's key,
|
|
4
|
+
* in the form's current order. Markers follow the key, not the index, so
|
|
5
|
+
* they move with the block when it is reordered (before or after saving).
|
|
6
|
+
* A block without a key (new, unsaved) gets no marker.
|
|
7
|
+
*/
|
|
8
|
+
export declare function markersFor(blockKeys: Array<string | null | undefined>, byBlockKey: Record<string, BlockCard> | undefined): Array<BlockCard | null>;
|
|
9
|
+
/** Selector-friendly encoding of the zone's keys (stable string, so the form selector doesn't re-render on every keystroke). */
|
|
10
|
+
export declare const KEY_SEPARATOR = "\u0001";
|
|
11
|
+
export declare function encodeKeys(blocks: unknown): string;
|
|
12
|
+
export declare function decodeKeys(encoded: string): Array<string | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BlockCard, InspectView } from '../api/types';
|
|
2
|
+
/**
|
|
3
|
+
* What the modal lists: the block cards in the draft's block order, then
|
|
4
|
+
* orphaned mappings separately. With `focusKey`, only that block.
|
|
5
|
+
*/
|
|
6
|
+
export declare function modalCards(view: InspectView, focusKey?: string | null): {
|
|
7
|
+
cards: BlockCard[];
|
|
8
|
+
orphaned: BlockCard[];
|
|
9
|
+
raw: unknown;
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Set by the server in register (`pluginOptions['experience-context']`) on every target type. */
|
|
2
|
+
export declare function isTargetType(options: Record<string, any> | undefined | null): boolean;
|
|
3
|
+
/** The dynamic zone whose `zone.*` blocks carry experience mappings. */
|
|
4
|
+
export declare const CONTENT_ZONE = "content";
|
|
5
|
+
/** `{ collectionType, uid, documentId }` from a Content Manager path, or null. */
|
|
6
|
+
export declare function parseCmPath(pathname: string): {
|
|
7
|
+
collectionType: string;
|
|
8
|
+
uid: string;
|
|
9
|
+
documentId: string | null;
|
|
10
|
+
} | null;
|
|
11
|
+
/** The i18n locale of a Content Manager URL (`?plugins[i18n][locale]=fi`), or null. */
|
|
12
|
+
export declare function localeFromSearch(search: string): string | null;
|