@staging-apiplus/essentials 0.0.2 → 0.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/README.md CHANGED
@@ -1,31 +1,61 @@
1
1
  # `@staging-apiplus/essentials`
2
2
 
3
- First-party QuickPage code package: **gallery** (code component) and **slider** / **tab** (logic). Source for the **System library** snapshot (`@staging-apiplus/essentials`).
3
+ First-party QuickPage code package: **gallery** (code component) and **slider** / **tab** (logic; `slider` never writes layout styles at runtime). Source for the **System library** snapshot (`@staging-apiplus/essentials`).
4
4
 
5
5
  ## Tooling dependencies
6
6
 
7
- | Context | `@packages/qp-sdk` / `@packages/qp-cli` |
7
+ | Context | `@packages/qp-sdk` / `@packages/app-cli` |
8
8
  | --- | --- |
9
9
  | **Monorepo root** `pnpm install` | `workspace:@packages/qp-*@^0.0.1` — links in-tree packages (no Verdaccio required) |
10
- | **Registry-shaped** (same as external authors) | `make publish-qp-tooling-dev` with mock-registry up, then `pnpm install` in this folder — resolves via [`.npmrc`](../.npmrc) at `^0.0.1` |
10
+ | **Registry-shaped** (same as external authors) | `make publish-code-packages-dev` with mock-registry up, then `pnpm install` in this folder — resolves via [`.npmrc`](../../.npmrc) at `^0.0.1` |
11
11
 
12
12
  No Node `imports` map to `packages/qp_sdk/src` — builds use published SDK layout like third-party packages.
13
13
 
14
14
  ## Commands
15
15
 
16
16
  ```bash
17
- pnpm run dev # qp dev — playground + HMR (+ QuickPage Link dev for editor/preview)
18
- pnpm run build # qp build → dist/ (also via make build-code-packages)
19
- pnpm run validate # qp validate
17
+ pnpm run dev # apps dev — playground + HMR (+ QuickPage Link dev for editor/preview)
18
+ pnpm run build # apps build → dist/ (also via make build-code-packages)
19
+ pnpm run validate # apps validate
20
20
  pnpm run test:unit # schema + DOM helper tests
21
21
  ```
22
22
 
23
+ ## Slider
24
+
25
+ | Prop | Default | Behavior |
26
+ | --- | --- | --- |
27
+ | `loop` | `true` | Infinite loop in preview and on published pages. Next on the last slide moves on to the first one in the same direction, and Previous on the first moves back to the last. No slides are cloned: each slide is moved to the end of the track that is nearest to the active slide. The track needs at least two slides. Prev/next stay enabled at both ends. When `false`, the index clamps and prev/next are disabled at the ends. The editor canvas shows the chosen slide with no wrap animation. |
28
+ | `speed` | `400` | Transition time in ms. |
29
+ | `autoplay` / `autoplayDelay` | `false` / `3000` | Advances one slide per delay; follows `loop` at the last slide. |
30
+
31
+ The runtime treats a missing `loop` as `true`, so attachments saved before the prop existed also loop. Designers toggle **Loop** in the slide settings panel; it writes `loop` through `libraryLogic.updateProps`.
32
+
33
+ Designers toggle **Autoplay** and set **Speed** in the same panel. Autoplay writes `autoplay`; Speed writes `autoplayDelay` (the time between slides, not the `speed` transition time), clamped to a minimum of 500 ms, and is disabled while Autoplay is off.
34
+
35
+ Swipe: in preview and published pages, dragging a slide along the slide axis (horizontal or vertical, from the wrapper's `flexDirection`) follows the pointer and settles on the next or previous slide when released past ~40px (a third of the slide for small slides); respects `loop`, pauses autoplay while dragging, and swallows the click that ends a drag. Starting across the axis scrolls the page (`touch-action` is set to `pan-y` / `pan-x`). Prev/next/pagination controls are not swipe handles. The editor canvas has no swipe, so selection and layer drags are unaffected.
36
+
37
+ ### Slide settings modal
38
+
39
+ Opened from the slider's header button on the slider host. The slider declares it in `slider/editor/editor.ts` (`editorPanel.dialog`); QuickPage renders the generic logic editor dialog (`interaction/logic/editor_dialog/`), so its button, controls and slide list come from that declaration.
40
+
41
+ | Behavior | Rule |
42
+ | --- | --- |
43
+ | Source | The top card shows the repeat source bound to the **first slide** (the repeated template), or **Non-sourced** when none. Clicking opens the Source picker (Variables / Components); the slide count follows the source. Shown even with no slides, but inert until a slide exists. |
44
+ | Slides | List, reorder, rename, duplicate, set default, delete, and add run through the slider editor plugin actions; clicking a slide previews it on the canvas (cleared on close). |
45
+ | Direction | The `setDirection` action writes `flexDirection` on the `wrapper` role node. |
46
+ | Dragging | Drag by the title bar; clamped to the viewport; resets to the anchored position on reopen. |
47
+ | Closing | The close button, or any selection change whose primary node is neither the slider host nor a descendant (slides keep it open; clearing the selection closes it). Wired in `SelectionState.#dismissSelectionScopedUi` through `logicEditorDialog`. |
48
+
49
+ ### Binding wires (Connect panel)
50
+
51
+ The **Connect** button on a Logic row opens the Connect sub-panel (`interaction/logic/connect/logic_connect.svelte`), laid out like Repeater Connect (title "Connect <logic>", an Output count, then one row per wire). Each wiring key from the logic's wiring schema (e.g. slider wrapper, pagination) is a row showing the bound layer or **Not bound**. **Connect** / **Rebind** starts a canvas pick (button turns **Cancel** while picking; the next click on a layer inside the slider host binds it). The panel closes with the back button, or when the selection leaves the slider host (`closeSubPanelIfInvalid`); closing cancels any running pick. The old "Bind nodes" rows in the expanded Logic row were removed.
52
+
23
53
  ## Author documentation
24
54
 
25
55
  Lifecycle (editor / preview / published), SDK APIs, and logic tiers — applies to **all** code packages:
26
56
 
27
- **[Module author guide](../../docs/code-packages/guides/module-author.md)** — CE + `designTime` logic. In QuickPage, attach tab/slider via **Code → Logic → Apply** on wired chrome ([logic presets](../../docs/code-packages/guides/logic-presets.md)).
57
+ **[Module author guide](../../../docs/code-packages/guides/module-author.md)** — CE + `designTime` logic. In QuickPage, attach tab/slider via **Code → Logic → Apply** on wired chrome ([logic presets](../../../docs/code-packages/guides/logic-presets.md)).
28
58
 
29
- **Dev (Tilt + isolate):** [consolidated dev flow](../../docs/code-packages/guides/development.md#consolidated-dev-flow-canonical) — **Link dev** for HMR; **`qp publish`** to dev registry then **Refresh in editor** / reload staging.
59
+ **Dev (Tilt + isolate):** [consolidated dev flow](../../../docs/code-packages/guides/development.md#consolidated-dev-flow-canonical) — **Link dev** for HMR; **`apps publish`** to dev registry then **Refresh in editor** / reload staging.
30
60
 
31
- Broader context: [code packages hub](../../docs/code-packages/README.md), [artifact scenarios (all envs)](../../docs/code-packages/reference/artifact-scenarios.md), [author quickstart](../../packages/qp_sdk/docs/author-quickstart.md).
61
+ Broader context: [code packages hub](../../../docs/code-packages/README.md), [artifact scenarios (all envs)](../../../docs/code-packages/reference/artifact-scenarios.md), [author quickstart](../../../packages/qp_sdk/docs/author-quickstart.md).
@@ -1,16 +1,14 @@
1
1
  {
2
+ "kind": "package",
2
3
  "id": "@staging-apiplus/essentials",
3
- "version": "0.0.2",
4
+ "version": "0.0.4",
4
5
  "engine": "^1.0.0",
5
6
  "framework": "svelte",
6
7
  "capabilities": [
7
8
  "document:component:render",
8
9
  "document:logic:mount",
9
- "editor:plugin:load"
10
+ "editor:logic-editor:load"
10
11
  ],
11
- "library": {
12
- "category": "Custom"
13
- },
14
12
  "modules": {
15
13
  "components": [
16
14
  {
@@ -38,15 +36,8 @@
38
36
  "items": {
39
37
  "content": {
40
38
  "list": "wrapper",
41
- "hideInactive": true
42
- },
43
- "markers": {
44
- "list": "pagination",
45
- "template": "paginationDot",
46
- "variables": [
47
- "slideIndex",
48
- "slideNumber"
49
- ]
39
+ "item": "slide",
40
+ "shiftToActive": true
50
41
  },
51
42
  "add": {
52
43
  "label": "Add slide",
@@ -76,6 +67,9 @@
76
67
  "chromeNavigation": {
77
68
  "prevRole": "prev",
78
69
  "nextRole": "next"
70
+ },
71
+ "unboundRoleParents": {
72
+ "paginationDot": "pagination"
79
73
  }
80
74
  },
81
75
  "schema": "./dist/slider.schema.json",
@@ -1,14 +1,16 @@
1
- //#region ../../packages/qp_sdk/src/define/define_logic_editor.ts
1
+ //#region ../../../packages/qp_sdk/src/define/define_logic_editor.ts
2
2
  function e(e) {
3
3
  return {
4
4
  kind: "logic-editor",
5
5
  editorPanel: e.editorPanel,
6
6
  mount: e.mount ?? (() => {}),
7
- onAction: e.onAction
7
+ onAction: e.onAction,
8
+ onWireBound: e.onWireBound,
9
+ insert: e.insert
8
10
  };
9
11
  }
10
12
  //#endregion
11
- //#region ../../packages/qp_sdk/src/editor/derive_logic_editor_panel.ts
13
+ //#region ../../../packages/qp_sdk/src/editor/derive_logic_editor_panel.ts
12
14
  function t(e, t, n) {
13
15
  if (!e?.items) return [];
14
16
  let r = e.activeIndexStateKey, i = [], a = n?.includeSettings ?? !0, o = n?.includeStates ?? !0;
@@ -38,6 +40,7 @@ function t(e, t, n) {
38
40
  id: "content-items",
39
41
  label: e.items.add?.label ?? "Items",
40
42
  role: t.contentRole,
43
+ parentRole: e.items.content.list,
41
44
  activeStateKey: r,
42
45
  suggestClass: n?.suggestClass,
43
46
  actions: a
@@ -1,4 +1,4 @@
1
- import { t as e } from "./logic_role_kind-DV5olnbL.js";
1
+ import { t as e } from "./logic_role_kind-BQg9qOUj.js";
2
2
  //#region src/tab/editor/roles.ts
3
3
  var t = {
4
4
  Host: "tabs",
@@ -1,4 +1,4 @@
1
- import { t as e } from "./logic_role_kind-DV5olnbL.js";
1
+ import { t as e } from "./logic_role_kind-BQg9qOUj.js";
2
2
  //#region src/slider/editor/roles.ts
3
3
  var t = {
4
4
  Host: "slider",
@@ -8,22 +8,27 @@ var t = {
8
8
  PaginationDot: "paginationDot",
9
9
  Prev: "prev",
10
10
  Next: "next"
11
- };
12
- t.Wrapper, e.Container, t.Slide, e.Repeatable, t.Pagination, e.Control, t.PaginationDot, e.Repeatable, t.Prev, e.Control, t.Next, e.Control;
13
- //#endregion
14
- //#region src/slider/editor/design_time.ts
15
- var n = {
11
+ }, n = {
12
+ [t.Wrapper]: {
13
+ kind: e.Container,
14
+ owns: [t.Slide]
15
+ },
16
+ [t.Slide]: { kind: e.Repeatable },
17
+ [t.Pagination]: {
18
+ kind: e.Control,
19
+ owns: [t.PaginationDot]
20
+ },
21
+ [t.PaginationDot]: { kind: e.Repeatable },
22
+ [t.Prev]: { kind: e.Control },
23
+ [t.Next]: { kind: e.Control }
24
+ }, r = {
16
25
  mode: "active-item",
17
26
  activeIndexStateKey: "activeSlideIndex",
18
27
  items: {
19
28
  content: {
20
29
  list: t.Wrapper,
21
- hideInactive: !0
22
- },
23
- markers: {
24
- list: t.Pagination,
25
- template: t.PaginationDot,
26
- variables: ["slideIndex", "slideNumber"]
30
+ item: t.Slide,
31
+ shiftToActive: !0
27
32
  },
28
33
  add: {
29
34
  label: "Add slide",
@@ -41,7 +46,8 @@ var n = {
41
46
  chromeNavigation: {
42
47
  prevRole: t.Prev,
43
48
  nextRole: t.Next
44
- }
49
+ },
50
+ unboundRoleParents: { [t.PaginationDot]: t.Pagination }
45
51
  };
46
52
  //#endregion
47
- export { t as n, n as t };
53
+ export { n, t as r, r as t };
@@ -1,5 +1,5 @@
1
1
  {
2
- "quickpage": {
2
+ "app": {
3
3
  "id": "gallery",
4
4
  "kind": "component",
5
5
  "name": "gallery"