@rippling/pebble-sdui-mobile 0.16.0 → 0.17.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.
- package/dist/catalogs/custom-apps/action-params.d.ts +3 -0
- package/dist/catalogs/custom-apps/actions.d.ts +2 -1
- package/dist/catalogs/custom-apps/catalog.d.ts +3 -1
- package/dist/catalogs/custom-apps/index.cjs +5 -5
- package/dist/catalogs/custom-apps/index.cjs.map +1 -1
- package/dist/catalogs/custom-apps/index.d.ts +3 -3
- package/dist/catalogs/custom-apps/index.js +1113 -1072
- package/dist/catalogs/custom-apps/index.js.map +1 -1
- package/dist/core/component-markdown.cjs +19 -0
- package/dist/core/component-markdown.cjs.map +1 -0
- package/dist/core/component-markdown.d.ts +8 -0
- package/dist/core/component-markdown.js +58 -0
- package/dist/core/component-markdown.js.map +1 -0
- package/dist/docs/typescript/mobile/catalogs/custom-apps/actions.md +26 -0
- package/dist/docs/typescript/mobile/catalogs/custom-apps/readme.md +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(t){return`\`\`\`json
|
|
2
|
+
${JSON.stringify(t,null,2)??"null"}
|
|
3
|
+
\`\`\``}function l(t){return t.replace(/\r\n?|\n/g," ").trim()}function y(t){return Array.isArray(t)&&t.every(e=>typeof e=="string")?t.map(e=>`- ${l(e)}`).join(`
|
|
4
|
+
`):a(t)}function m(t,e,g){const r=[`# ${t}`,"> **Source precedence:** The SDUI contract and usage notes below are authoritative. Supplementary design-system guidance is additional context; ignore it where it conflicts with the SDUI contract.","## SDUI contract"],s=e.description,o=e.docs;typeof s=="string"&&s.length>0&&r.push(`### Description
|
|
5
|
+
|
|
6
|
+
${s}`),typeof o=="string"&&o.length>0&&r.push(`### Usage notes
|
|
7
|
+
|
|
8
|
+
${o}`);const u=Array.isArray(e.events)?e.events.filter(n=>typeof n=="string"):[],i=Array.isArray(e.slots)?e.slots.filter(n=>typeof n=="string"):[];r.push(["### Structure and events","",`- Accepts children: ${e.acceptsChildren===!0?"yes":"no"}`,`- Events: ${u.length>0?u.map(n=>`\`${l(n)}\``).join(", "):"none"}`,`- Slots: ${i.length>0?i.map(n=>`\`${l(n)}\``).join(", "):"none"}`].join(`
|
|
9
|
+
`)),e.propsSchema!==void 0&&r.push(`### Props schema
|
|
10
|
+
|
|
11
|
+
${a(e.propsSchema)}`),e.example!==void 0&&r.push(`### Example
|
|
12
|
+
|
|
13
|
+
${a(e.example)}`);const c=[];for(const{field:n,title:h}of g){const p=e[n];p!=null&&c.push(`### ${h}
|
|
14
|
+
|
|
15
|
+
${y(p)}`)}return c.length>0&&r.push("## Supplementary design-system guidance",...c),`${r.join(`
|
|
16
|
+
|
|
17
|
+
`)}
|
|
18
|
+
`}exports.renderComponentMarkdown=m;
|
|
19
|
+
//# sourceMappingURL=component-markdown.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-markdown.cjs","sources":["../../../sdui-core/src/component-markdown.ts"],"sourcesContent":["type CatalogObject = Record<string, unknown>;\ntype KnowledgeSection = Readonly<{ field: string; title: string }>;\n\nfunction jsonBlock(value: unknown): string {\n return `\\`\\`\\`json\\n${JSON.stringify(value, null, 2) ?? 'null'}\\n\\`\\`\\``;\n}\n\nfunction singleLine(value: string): string {\n return value.replace(/\\r\\n?|\\n/g, ' ').trim();\n}\n\nfunction renderValue(value: unknown): string {\n if (Array.isArray(value) && value.every(item => typeof item === 'string')) {\n return value.map(item => `- ${singleLine(item)}`).join('\\n');\n }\n return jsonBlock(value);\n}\n\n/** Render self-contained, LLM-ready Markdown from one raw catalog component. */\nexport function renderComponentMarkdown(\n name: string,\n definition: CatalogObject,\n knowledgeSections: readonly KnowledgeSection[]\n): string {\n const sections: string[] = [\n `# ${name}`,\n '> **Source precedence:** The SDUI contract and usage notes below are authoritative. Supplementary design-system guidance is additional context; ignore it where it conflicts with the SDUI contract.',\n '## SDUI contract',\n ];\n const description = definition.description;\n const docs = definition.docs;\n\n if (typeof description === 'string' && description.length > 0) {\n sections.push(`### Description\\n\\n${description}`);\n }\n if (typeof docs === 'string' && docs.length > 0) {\n sections.push(`### Usage notes\\n\\n${docs}`);\n }\n\n const events = Array.isArray(definition.events)\n ? definition.events.filter(\n (event): event is string => typeof event === 'string'\n )\n : [];\n const slots = Array.isArray(definition.slots)\n ? definition.slots.filter(\n (slot): slot is string => typeof slot === 'string'\n )\n : [];\n sections.push(\n [\n '### Structure and events',\n '',\n `- Accepts children: ${definition.acceptsChildren === true ? 'yes' : 'no'}`,\n `- Events: ${events.length > 0 ? events.map(event => `\\`${singleLine(event)}\\``).join(', ') : 'none'}`,\n `- Slots: ${slots.length > 0 ? slots.map(slot => `\\`${singleLine(slot)}\\``).join(', ') : 'none'}`,\n ].join('\\n')\n );\n\n if (definition.propsSchema !== undefined) {\n sections.push(`### Props schema\\n\\n${jsonBlock(definition.propsSchema)}`);\n }\n if (definition.example !== undefined) {\n sections.push(`### Example\\n\\n${jsonBlock(definition.example)}`);\n }\n\n const knowledge: string[] = [];\n for (const { field, title } of knowledgeSections) {\n const value = definition[field];\n if (value !== undefined && value !== null) {\n knowledge.push(`### ${title}\\n\\n${renderValue(value)}`);\n }\n }\n if (knowledge.length > 0) {\n sections.push('## Supplementary design-system guidance', ...knowledge);\n }\n\n return `${sections.join('\\n\\n')}\\n`;\n}\n"],"names":["jsonBlock","value","singleLine","renderValue","item","renderComponentMarkdown","name","definition","knowledgeSections","sections","description","docs","events","event","slots","slot","knowledge","field","title"],"mappings":"gFAGA,SAASA,EAAUC,EAAwB,CACzC,MAAO;AAAA,EAAe,KAAK,UAAUA,EAAO,KAAM,CAAC,GAAK,MAAM;AAAA,OAChE,CAEA,SAASC,EAAWD,EAAuB,CACzC,OAAOA,EAAM,QAAQ,YAAa,GAAG,EAAE,KAAA,CACzC,CAEA,SAASE,EAAYF,EAAwB,CAC3C,OAAI,MAAM,QAAQ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E,EAGjE,MAAMS,EAAsB,CAAA,EAC5B,SAAW,CAAE,MAAAC,EAAO,MAAAC,CAAA,IAAWV,EAAmB,CAChD,MAAMP,EAAQM,EAAWU,CAAK,EACHhB,GAAU,MACnCe,EAAU,KAAK,OAAOE,CAAK;AAAA;AAAA,EAAOf,EAAYF,CAAK,CAAC,EAAE,CAE1D,CACA,OAAIe,EAAU,OAAS,GACrBP,EAAS,KAAK,0CAA2C,GAAGO,CAAS,EAGhE,GAAGP,EAAS,KAAK;AAAA;AAAA,CAAM,CAAC;AAAA,CACjC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type CatalogObject = Record<string, unknown>;
|
|
2
|
+
type KnowledgeSection = Readonly<{
|
|
3
|
+
field: string;
|
|
4
|
+
title: string;
|
|
5
|
+
}>;
|
|
6
|
+
/** Render self-contained, LLM-ready Markdown from one raw catalog component. */
|
|
7
|
+
export declare function renderComponentMarkdown(name: string, definition: CatalogObject, knowledgeSections: readonly KnowledgeSection[]): string;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function a(t) {
|
|
2
|
+
return `\`\`\`json
|
|
3
|
+
${JSON.stringify(t, null, 2) ?? "null"}
|
|
4
|
+
\`\`\``;
|
|
5
|
+
}
|
|
6
|
+
function l(t) {
|
|
7
|
+
return t.replace(/\r\n?|\n/g, " ").trim();
|
|
8
|
+
}
|
|
9
|
+
function y(t) {
|
|
10
|
+
return Array.isArray(t) && t.every((e) => typeof e == "string") ? t.map((e) => `- ${l(e)}`).join(`
|
|
11
|
+
`) : a(t);
|
|
12
|
+
}
|
|
13
|
+
function m(t, e, h) {
|
|
14
|
+
const s = [
|
|
15
|
+
`# ${t}`,
|
|
16
|
+
"> **Source precedence:** The SDUI contract and usage notes below are authoritative. Supplementary design-system guidance is additional context; ignore it where it conflicts with the SDUI contract.",
|
|
17
|
+
"## SDUI contract"
|
|
18
|
+
], r = e.description, o = e.docs;
|
|
19
|
+
typeof r == "string" && r.length > 0 && s.push(`### Description
|
|
20
|
+
|
|
21
|
+
${r}`), typeof o == "string" && o.length > 0 && s.push(`### Usage notes
|
|
22
|
+
|
|
23
|
+
${o}`);
|
|
24
|
+
const u = Array.isArray(e.events) ? e.events.filter(
|
|
25
|
+
(n) => typeof n == "string"
|
|
26
|
+
) : [], i = Array.isArray(e.slots) ? e.slots.filter(
|
|
27
|
+
(n) => typeof n == "string"
|
|
28
|
+
) : [];
|
|
29
|
+
s.push(
|
|
30
|
+
[
|
|
31
|
+
"### Structure and events",
|
|
32
|
+
"",
|
|
33
|
+
`- Accepts children: ${e.acceptsChildren === !0 ? "yes" : "no"}`,
|
|
34
|
+
`- Events: ${u.length > 0 ? u.map((n) => `\`${l(n)}\``).join(", ") : "none"}`,
|
|
35
|
+
`- Slots: ${i.length > 0 ? i.map((n) => `\`${l(n)}\``).join(", ") : "none"}`
|
|
36
|
+
].join(`
|
|
37
|
+
`)
|
|
38
|
+
), e.propsSchema !== void 0 && s.push(`### Props schema
|
|
39
|
+
|
|
40
|
+
${a(e.propsSchema)}`), e.example !== void 0 && s.push(`### Example
|
|
41
|
+
|
|
42
|
+
${a(e.example)}`);
|
|
43
|
+
const c = [];
|
|
44
|
+
for (const { field: n, title: g } of h) {
|
|
45
|
+
const p = e[n];
|
|
46
|
+
p != null && c.push(`### ${g}
|
|
47
|
+
|
|
48
|
+
${y(p)}`);
|
|
49
|
+
}
|
|
50
|
+
return c.length > 0 && s.push("## Supplementary design-system guidance", ...c), `${s.join(`
|
|
51
|
+
|
|
52
|
+
`)}
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
m as renderComponentMarkdown
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=component-markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-markdown.js","sources":["../../../sdui-core/src/component-markdown.ts"],"sourcesContent":["type CatalogObject = Record<string, unknown>;\ntype KnowledgeSection = Readonly<{ field: string; title: string }>;\n\nfunction jsonBlock(value: unknown): string {\n return `\\`\\`\\`json\\n${JSON.stringify(value, null, 2) ?? 'null'}\\n\\`\\`\\``;\n}\n\nfunction singleLine(value: string): string {\n return value.replace(/\\r\\n?|\\n/g, ' ').trim();\n}\n\nfunction renderValue(value: unknown): string {\n if (Array.isArray(value) && value.every(item => typeof item === 'string')) {\n return value.map(item => `- ${singleLine(item)}`).join('\\n');\n }\n return jsonBlock(value);\n}\n\n/** Render self-contained, LLM-ready Markdown from one raw catalog component. */\nexport function renderComponentMarkdown(\n name: string,\n definition: CatalogObject,\n knowledgeSections: readonly KnowledgeSection[]\n): string {\n const sections: string[] = [\n `# ${name}`,\n '> **Source precedence:** The SDUI contract and usage notes below are authoritative. Supplementary design-system guidance is additional context; ignore it where it conflicts with the SDUI contract.',\n '## SDUI contract',\n ];\n const description = definition.description;\n const docs = definition.docs;\n\n if (typeof description === 'string' && description.length > 0) {\n sections.push(`### Description\\n\\n${description}`);\n }\n if (typeof docs === 'string' && docs.length > 0) {\n sections.push(`### Usage notes\\n\\n${docs}`);\n }\n\n const events = Array.isArray(definition.events)\n ? definition.events.filter(\n (event): event is string => typeof event === 'string'\n )\n : [];\n const slots = Array.isArray(definition.slots)\n ? definition.slots.filter(\n (slot): slot is string => typeof slot === 'string'\n )\n : [];\n sections.push(\n [\n '### Structure and events',\n '',\n `- Accepts children: ${definition.acceptsChildren === true ? 'yes' : 'no'}`,\n `- Events: ${events.length > 0 ? events.map(event => `\\`${singleLine(event)}\\``).join(', ') : 'none'}`,\n `- Slots: ${slots.length > 0 ? slots.map(slot => `\\`${singleLine(slot)}\\``).join(', ') : 'none'}`,\n ].join('\\n')\n );\n\n if (definition.propsSchema !== undefined) {\n sections.push(`### Props schema\\n\\n${jsonBlock(definition.propsSchema)}`);\n }\n if (definition.example !== undefined) {\n sections.push(`### Example\\n\\n${jsonBlock(definition.example)}`);\n }\n\n const knowledge: string[] = [];\n for (const { field, title } of knowledgeSections) {\n const value = definition[field];\n if (value !== undefined && value !== null) {\n knowledge.push(`### ${title}\\n\\n${renderValue(value)}`);\n }\n }\n if (knowledge.length > 0) {\n sections.push('## Supplementary design-system guidance', ...knowledge);\n }\n\n return `${sections.join('\\n\\n')}\\n`;\n}\n"],"names":["jsonBlock","value","singleLine","renderValue","item","renderComponentMarkdown","name","definition","knowledgeSections","sections","description","docs","events","event","slots","slot","knowledge","field","title"],"mappings":"AAGA,SAASA,EAAUC,GAAwB;AACzC,SAAO;AAAA,EAAe,KAAK,UAAUA,GAAO,MAAM,CAAC,KAAK,MAAM;AAAA;AAChE;AAEA,SAASC,EAAWD,GAAuB;AACzC,SAAOA,EAAM,QAAQ,aAAa,GAAG,EAAE,KAAA;AACzC;AAEA,SAASE,EAAYF,GAAwB;AAC3C,SAAI,MAAM,QAAQA,CAAK,KAAKA,EAAM,MAAM,CAAAG,MAAQ,OAAOA,KAAS,QAAQ,IAC/DH,EAAM,IAAI,CAAAG,MAAQ,KAAKF,EAAWE,CAAI,CAAC,EAAE,EAAE,KAAK;AAAA,CAAI,IAEtDJ,EAAUC,CAAK;AACxB;AAGO,SAASI,EACdC,GACAC,GACAC,GACQ;AACR,QAAMC,IAAqB;AAAA,IACzB,KAAKH,CAAI;AAAA,IACT;AAAA,IACA;AAAA,EAAA,GAEII,IAAcH,EAAW,aACzBI,IAAOJ,EAAW;AAExB,EAAI,OAAOG,KAAgB,YAAYA,EAAY,SAAS,KAC1DD,EAAS,KAAK;AAAA;AAAA,EAAsBC,CAAW,EAAE,GAE/C,OAAOC,KAAS,YAAYA,EAAK,SAAS,KAC5CF,EAAS,KAAK;AAAA;AAAA,EAAsBE,CAAI,EAAE;AAG5C,QAAMC,IAAS,MAAM,QAAQL,EAAW,MAAM,IAC1CA,EAAW,OAAO;AAAA,IAChB,CAACM,MAA2B,OAAOA,KAAU;AAAA,EAAA,IAE/C,CAAA,GACEC,IAAQ,MAAM,QAAQP,EAAW,KAAK,IACxCA,EAAW,MAAM;AAAA,IACf,CAACQ,MAAyB,OAAOA,KAAS;AAAA,EAAA,IAE5C,CAAA;AACJ,EAAAN,EAAS;AAAA,IACP;AAAA,MACE;AAAA,MACA;AAAA,MACA,uBAAuBF,EAAW,oBAAoB,KAAO,QAAQ,IAAI;AAAA,MACzE,aAAaK,EAAO,SAAS,IAAIA,EAAO,IAAI,CAAAC,MAAS,KAAKX,EAAWW,CAAK,CAAC,IAAI,EAAE,KAAK,IAAI,IAAI,MAAM;AAAA,MACpG,YAAYC,EAAM,SAAS,IAAIA,EAAM,IAAI,CAAAC,MAAQ,KAAKb,EAAWa,CAAI,CAAC,IAAI,EAAE,KAAK,IAAI,IAAI,MAAM;AAAA,IAAA,EAC/F,KAAK;AAAA,CAAI;AAAA,EAAA,GAGTR,EAAW,gBAAgB,UAC7BE,EAAS,KAAK;AAAA;AAAA,EAAuBT,EAAUO,EAAW,WAAW,CAAC,EAAE,GAEtEA,EAAW,YAAY,UACzBE,EAAS,KAAK;AAAA;AAAA,EAAkBT,EAAUO,EAAW,OAAO,CAAC,EAAE;AAGjE,QAAMS,IAAsB,CAAA;AAC5B,aAAW,EAAE,OAAAC,GAAO,OAAAC,EAAA,KAAWV,GAAmB;AAChD,UAAMP,IAAQM,EAAWU,CAAK;AAC9B,IAA2BhB,KAAU,QACnCe,EAAU,KAAK,OAAOE,CAAK;AAAA;AAAA,EAAOf,EAAYF,CAAK,CAAC,EAAE;AAAA,EAE1D;AACA,SAAIe,EAAU,SAAS,KACrBP,EAAS,KAAK,2CAA2C,GAAGO,CAAS,GAGhE,GAAGP,EAAS,KAAK;AAAA;AAAA,CAAM,CAAC;AAAA;AACjC;"}
|
|
@@ -3,6 +3,32 @@
|
|
|
3
3
|
|
|
4
4
|
Import action creators from `@rippling/pebble-sdui-mobile/catalogs/custom-apps`. Read [definitions.md](./definitions.md) for enum values linked from param tables.
|
|
5
5
|
|
|
6
|
+
## copyToClipboard
|
|
7
|
+
|
|
8
|
+
Copy text to the device clipboard.
|
|
9
|
+
|
|
10
|
+
`text` (required): the resolved text to place on the device clipboard.
|
|
11
|
+
|
|
12
|
+
Catalog key: `copyToClipboard`
|
|
13
|
+
Creator: `copyToClipboard`
|
|
14
|
+
Params type: `CopyToClipboardParams`
|
|
15
|
+
|
|
16
|
+
### Params
|
|
17
|
+
|
|
18
|
+
| Name | Required | Type | Description |
|
|
19
|
+
|---|---:|---|---|
|
|
20
|
+
| `text` | yes | string | Text to copy to the device clipboard. |
|
|
21
|
+
|
|
22
|
+
No additional properties.
|
|
23
|
+
|
|
24
|
+
### Usage Shape
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
on: {
|
|
28
|
+
press: copyToClipboard({ ... })
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
6
32
|
## goBack
|
|
7
33
|
|
|
8
34
|
Mobile-specific action that goes back to the previous screen in the navigation stack.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# custom-apps Catalog
|
|
3
3
|
|
|
4
4
|
Catalog: `custom-apps`
|
|
5
|
-
Version: `1.
|
|
5
|
+
Version: `1.8.0`
|
|
6
6
|
SDK language: `typescript`
|
|
7
7
|
|
|
8
8
|
Use this catalog index after you have chosen this catalog for the spec. Do not mix components, actions, computed functions, or render helpers from another catalog unless that catalog explicitly documents compatibility.
|