create-kywi-app 0.30.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -887,6 +887,67 @@ early, so ask at scoping time.
887
887
  `Link` header. Never write a static `public/llms.txt` or a hand-made `.md`
888
888
  file — the generated ones follow every publish.
889
889
 
890
+ ## When the user pastes a `kywi:` reference
891
+
892
+ The editor's module and section chrome has **Copy reference**, which copies one
893
+ line like this for the owner to paste to you:
894
+
895
+ ```
896
+ kywi:marketing/page/3f2a91c0-…/m/7c91e2… — Heading "Run the whole room" on /about
897
+ ```
898
+
899
+ The token is the address; the text after ` — ` is what the owner was looking
900
+ at. Its grammar:
901
+
902
+ ```
903
+ kywi:{site}/{contentType}/{contentId}/{m|s}/{nodeId}[@pv:{variantId} | @ab:{experimentId}:{variantId}]
904
+ ```
905
+
906
+ `m` = module, `s` = section. `site` is the site's slug or UUID, or `_` when the
907
+ editor couldn't tell (the content id is unique across sites, so it still
908
+ resolves). The `@…` suffix appears only when the node was copied from a page
909
+ variant or a page A/B variant: those start as a copy of the default page and
910
+ reuse its node ids. A reference without it always means the default page.
911
+
912
+ 1. **Call `resolve_ref` first** with the whole line. It returns the page, where
913
+ the node sits, its props and props schema, ready-made `next` arguments, a
914
+ `design` hint and `warnings`.
915
+ 2. **Sanity-check against the description.** If the module type or text
916
+ doesn't match what the owner described, say so before editing.
917
+ 3. **Content or settings change** ("change the heading", "make the button say
918
+ Book a demo"): use the site tools with the `next` arguments
919
+ (`update_module_props`, `remove_module`, `add_module`). When `next` says the
920
+ node isn't directly addressable (an arm, a page variant), read the page with
921
+ `get_layout`, change that node by id in the copy `location` names, and write
922
+ it back with `update_layout`.
923
+ 4. **Design change** ("make this band tighter", "bigger image"): spacing and
924
+ colors live in the node's `style` (theme tokens). Markup and visual
925
+ behavior live in code: for a custom module, the component named by its
926
+ `defineModule` entry in `kywi.config.ts`; a built-in module's markup is not
927
+ yours to change, so use props/Style Overrides or propose a custom module.
928
+ 5. **Linked component** (a warning names it; this includes a module inside a
929
+ linked section): `next` carries no edit arguments. The live page renders the
930
+ component definition (`resolvedProps` when the node can be matched in it,
931
+ otherwise a `resolvedNote` saying the stored copy may differ), and editing
932
+ the component changes
933
+ every page that uses it. Check its reach (`list_components` with
934
+ `withUsage`) and confirm with the owner first. Never patch the placement
935
+ with `update_module_props`: that silently forks it into a page-local
936
+ override. If they want only this page changed, the instance has to be
937
+ detached first (the editor's Detach).
938
+ 6. **Inside a personalization or A/B arm** (`location.container`): the change
939
+ only reaches visitors in that arm. Confirm that's what the owner meant, and
940
+ edit the arm with `get_layout` + `update_layout`.
941
+ 7. **Ambiguous or not on the default page** (`ambiguous: true`, or
942
+ `notOnDefaultPage: true`, with several `locations` and no edit arguments):
943
+ the id occurs more than once in the copy the reference names, or the
944
+ reference has no variant suffix but the id is now only in page variants.
945
+ Ask the owner which one they meant (or to copy the reference again from
946
+ what's on screen); don't guess.
947
+ 8. **Stale reference** (the node or the variant was removed): `resolve_ref`
948
+ lists the page's current modules and sections. Match the owner's
949
+ description, then confirm the match with them before changing anything.
950
+
890
951
  ## Other capabilities worth knowing
891
952
 
892
953
  - **Comments:** a moderated Comments module (submissions land pending) for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kywi-app",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Scaffold a new Kywi CMS project — npx create-kywi-app my-site",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/Kywi-Software/kywi-cms#readme",