dsh-quick-actions 0.1.0-rc.3
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.en.md +199 -0
- package/README.md +199 -0
- package/cordis.patch.yml +29 -0
- package/lib/client.js +3901 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +737 -0
- package/lib/types/client/controller.d.ts +207 -0
- package/lib/types/client/dsh.d.ts +171 -0
- package/lib/types/client/index.d.ts +43 -0
- package/lib/types/client/manager/ActionForm.d.ts +20 -0
- package/lib/types/client/manager/ActionPanel.d.ts +15 -0
- package/lib/types/client/manager/ManagedRow.d.ts +40 -0
- package/lib/types/client/manager/ManagerPanel.d.ts +9 -0
- package/lib/types/client/manager/press.d.ts +38 -0
- package/lib/types/client/manager/search.d.ts +56 -0
- package/lib/types/client/manager/status.d.ts +23 -0
- package/lib/types/client/modal.d.ts +55 -0
- package/lib/types/client/session/ConfirmPanel.d.ts +23 -0
- package/lib/types/client/session/availability.d.ts +19 -0
- package/lib/types/client/session/execution.d.ts +86 -0
- package/lib/types/client/session/guards.d.ts +59 -0
- package/lib/types/client/surfaces/ActionFace.d.ts +21 -0
- package/lib/types/client/surfaces/ErrorBoundary.d.ts +31 -0
- package/lib/types/client/surfaces/QuickActionsSurface.d.ts +17 -0
- package/lib/types/client/surfaces/entries.d.ts +27 -0
- package/lib/types/client/surfaces/layout.d.ts +49 -0
- package/lib/types/client/surfaces/residency.d.ts +65 -0
- package/lib/types/host/config.d.ts +18 -0
- package/lib/types/host/index.d.ts +38 -0
- package/lib/types/host/presets.d.ts +26 -0
- package/lib/types/host/settings.d.ts +113 -0
- package/lib/types/index.d.ts +35 -0
- package/lib/types/locales/index.d.ts +34 -0
- package/lib/types/model/catalog.d.ts +63 -0
- package/lib/types/model/index.d.ts +13 -0
- package/lib/types/model/json.d.ts +11 -0
- package/lib/types/model/mutations.d.ts +98 -0
- package/lib/types/model/normalize.d.ts +15 -0
- package/lib/types/model/projection.d.ts +49 -0
- package/lib/types/model/settings.d.ts +48 -0
- package/lib/types/model/text.d.ts +28 -0
- package/lib/types/model/types.d.ts +89 -0
- package/lib/types/model/validation.d.ts +40 -0
- package/lib/types/styles/index.d.ts +39 -0
- package/lib/types/types.d.ts +11 -0
- package/lib/types.js +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Composer Quick Action surfaces' stylesheet (spec 8.2, 8.4).
|
|
3
|
+
*
|
|
4
|
+
* It is shipped as one string installed into a `<style data-plugin-css>` tag,
|
|
5
|
+
* the same shape and idempotence the first-party DSH client bundles use, rather
|
|
6
|
+
* than as CSS Modules: the Client build adapter produces one browser CJS file
|
|
7
|
+
* with no CSS pipeline (spec 11.2), and adding one would change a contract the
|
|
8
|
+
* bundle's own tests pin. Class names carry the `dsh-cqa-` prefix instead of a
|
|
9
|
+
* generated hash, which gives the same collision safety by convention.
|
|
10
|
+
*
|
|
11
|
+
* Colours are DSH alias theme tokens only — nothing here defines a palette, and
|
|
12
|
+
* nothing overrides a global theme (spec 8.4).
|
|
13
|
+
*
|
|
14
|
+
* ## The width rule (spec 8.2)
|
|
15
|
+
*
|
|
16
|
+
* The two layouts sit in different boxes, so they reach the same outer edges by
|
|
17
|
+
* different arithmetic:
|
|
18
|
+
*
|
|
19
|
+
* - `.dsh-cqa-ribbon` renders in the composer stack, outside the InputBar, which
|
|
20
|
+
* is the element that owns `--dsh-composer-side-clearance` as padding. It
|
|
21
|
+
* therefore subtracts that clearance from both sides itself.
|
|
22
|
+
* - `.dsh-cqa-bar` renders as the InputBar's last child, inside that padding, so
|
|
23
|
+
* it is simply `100%` wide.
|
|
24
|
+
*
|
|
25
|
+
* Both are then capped at `--dsh-composer-card-max-width` — the same cap the
|
|
26
|
+
* composer card uses — and centred, so their left and right edges coincide with
|
|
27
|
+
* the input box exactly rather than approximately.
|
|
28
|
+
*/
|
|
29
|
+
export declare const QUICK_ACTIONS_CSS = "\n.dsh-cqa-ribbon,\n.dsh-cqa-launcher {\n box-sizing: border-box;\n width: calc(100% - var(--dsh-composer-side-clearance) - var(--dsh-composer-side-clearance));\n max-width: var(--dsh-composer-card-max-width);\n margin: 0 auto;\n}\n.dsh-cqa-bar {\n box-sizing: border-box;\n width: 100%;\n max-width: var(--dsh-composer-card-max-width);\n margin: 0 auto;\n}\n\n.dsh-cqa-row {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n padding: 2px 0;\n}\n.dsh-cqa-row[data-density='narrow'] {\n gap: 6px;\n}\n\n.dsh-cqa-title {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n white-space: nowrap;\n}\n\n/* The ribbon overflows horizontally; the management entry never scrolls away. */\n.dsh-cqa-scroll {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1 1 auto;\n min-width: 0;\n overflow-x: auto;\n scrollbar-width: thin;\n}\n.dsh-cqa-fit {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n}\n.dsh-cqa-trailing {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: none;\n margin-left: auto;\n}\n\n/*\n * The capsule itself \u2014 height, radius, padding, colours, hover and \":disabled\"\n * \u2014 belongs to the official \"Button\". What is left here is what a shared\n * control cannot know (how it behaves inside these rows) plus what the\n * primitive does not supply. Nothing below may restate a Button property,\n * because the plugin class is applied after the primitive's and would win on\n * equal specificity.\n *\n * The focus ring is one of the things it does not supply: \"Button.module.css\"\n * and \"Pill.module.css\" carry no \":focus\" rule at all \u2014 the library leaves the\n * ring to each component that wants one (\"Input.module.css\" has\n * \":focus-within\", \"HoverCard\" and \"JsonTree\" their own). Spec 8.4 makes a\n * clear focus ring a hard gate, so it stays here for every control this plugin\n * renders.\n */\n.dsh-cqa-action,\n.dsh-cqa-entry {\n /* No global border-box reset exists in this stylesheet, and Button pads\n itself, so the cap has to count that padding to mean 240px on screen. */\n box-sizing: border-box;\n flex: none;\n /* Long labels truncate rather than pushing the row's other controls out. */\n max-width: 240px;\n}\n.dsh-cqa-action:focus-visible,\n.dsh-cqa-entry:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 1px;\n}\n/* \"aria-disabled\" is not \":disabled\": a control kept focusable while a write is\n in flight still has to read as inert, and no primitive expresses that. */\n.dsh-cqa-entry[aria-disabled='true'] {\n opacity: 0.5;\n cursor: default;\n}\n/* The searchable panel's rows stay native \u2014 a full-width, left-aligned list row\n is not a capsule \u2014 so they still need a focus ring of their own. */\n.dsh-cqa-panel-item:focus-visible,\n.dsh-cqa-link:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 1px;\n}\n.dsh-cqa-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-cqa-icon {\n flex: none;\n}\n/* The chip look is \"Pill\"'s; only its behaviour in a flex row is ours. */\n.dsh-cqa-badge,\n.dsh-cqa-tag {\n flex: none;\n}\n\n.dsh-cqa-note {\n box-sizing: border-box;\n width: 100%;\n margin: 4px 0 0;\n padding: 4px 8px;\n border-radius: 8px;\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.dsh-cqa-note-text {\n flex: 1 1 auto;\n min-width: 0;\n}\n.dsh-cqa-link {\n flex: none;\n border: 0;\n background: none;\n padding: 0;\n color: var(--dsw-alias-state-business-primary);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n text-decoration: underline;\n}\n\n/* Anchored surfaces: the popover list and the confirmation panel. */\n.dsh-cqa-anchor {\n position: relative;\n}\n.dsh-cqa-backdrop {\n position: fixed;\n z-index: 19;\n inset: 0;\n}\n.dsh-cqa-panel {\n position: absolute;\n z-index: 20;\n bottom: calc(100% + 6px);\n left: 0;\n box-sizing: border-box;\n max-width: min(100%, 360px);\n min-width: 220px;\n max-height: 260px;\n overflow-y: auto;\n padding: 6px;\n border: 0.5px solid var(--dsw-alias-border-l1);\n border-radius: 12px;\n background: var(--dsw-specific-tip);\n box-shadow: var(--dsw-elevation-soft);\n}\n.dsh-cqa-panel-head {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.dsh-cqa-panel-head .dsh-cqa-panel-title {\n flex: 1 1 auto;\n min-width: 0;\n}\n.dsh-cqa-panel-title {\n padding: 4px 8px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n.dsh-cqa-panel-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 6px 8px;\n border: 0;\n border-radius: 8px;\n background: none;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n.dsh-cqa-panel-item:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.dsh-cqa-panel-item:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.dsh-cqa-confirm-text {\n margin: 6px 0;\n padding: 8px;\n border-radius: 8px;\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n font-family: var(--ds-font-family-code);\n font-size: 12px;\n line-height: 18px;\n white-space: pre-wrap;\n word-break: break-word;\n max-height: 160px;\n overflow-y: auto;\n}\n.dsh-cqa-confirm-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n\n/* ------------------------------------------------------------------------- */\n/* Fields, shared by the search box and the Custom Quick Action form */\n/* ------------------------------------------------------------------------- */\n\n.dsh-cqa-field {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 4px 0;\n}\n.dsh-cqa-field-label {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n.dsh-cqa-field-hint {\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n line-height: 16px;\n}\n.dsh-cqa-field-error {\n color: var(--dsw-alias-state-danger-primary, var(--dsw-alias-label-primary));\n font-size: 11px;\n line-height: 16px;\n font-weight: 500;\n}\n\n.dsh-cqa-input,\n.dsh-cqa-textarea {\n box-sizing: border-box;\n width: 100%;\n padding: 4px 8px;\n border: 0.5px solid var(--dsw-alias-border-l1);\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n}\n.dsh-cqa-textarea {\n resize: vertical;\n min-height: 72px;\n font-family: var(--ds-font-family-code);\n white-space: pre-wrap;\n}\n.dsh-cqa-input:focus-visible,\n.dsh-cqa-textarea:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 1px;\n}\n.dsh-cqa-input:disabled,\n.dsh-cqa-textarea:disabled {\n opacity: 0.5;\n}\n\n.dsh-cqa-switch {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 0;\n cursor: pointer;\n}\n\n/* ------------------------------------------------------------------------- */\n/* The centralized management overlay */\n/* ------------------------------------------------------------------------- */\n\n/*\n * The overlay and its click-catching backdrop. Neither paints: only DSH alias\n * theme tokens may be used here, and this release has no token to spend on a\n * modal scrim (spec 8.4).\n *\n * These two numbers rank the overlay against its own backdrop, and nothing\n * else. Since ticket 26 the overlay is portaled to the document body, so it and\n * the anchored popovers (19 and 20, still rendered in the input dock) sit in\n * different stacking contexts: which of them paints on top follows from where\n * the dock's own ancestors land in the root context, not from comparing 31\n * against 20. Raising these would not change that.\n */\n.dsh-cqa-manager-backdrop {\n z-index: 30;\n}\n.dsh-cqa-manager {\n position: fixed;\n z-index: 31;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: min(560px, calc(100vw - 24px));\n max-height: min(80vh, 680px);\n overflow-y: auto;\n padding: 12px;\n border: 0.5px solid var(--dsw-alias-border-l1);\n border-radius: 12px;\n background: var(--dsw-specific-tip);\n color: var(--dsw-alias-label-primary);\n box-shadow: var(--dsw-elevation-soft);\n}\n\n.dsh-cqa-manager-head {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.dsh-cqa-manager-title {\n flex: 1 1 auto;\n min-width: 0;\n margin: 0;\n color: var(--dsw-alias-label-primary);\n font-size: 14px;\n font-weight: 600;\n line-height: 20px;\n}\n\n.dsh-cqa-section {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 6px 0;\n border-top: 0.5px solid var(--dsw-alias-border-l1);\n}\n.dsh-cqa-section-head {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n}\n.dsh-cqa-section-head .dsh-cqa-section-title {\n flex: 1 1 auto;\n}\n.dsh-cqa-section-title {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n}\n.dsh-cqa-group {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n}\n.dsh-cqa-entry[aria-pressed='true'] {\n background: var(--dsw-alias-state-business-tertiary);\n color: var(--dsw-alias-label-primary-bluish);\n opacity: 1;\n}\n\n.dsh-cqa-list {\n display: flex;\n flex-direction: column;\n gap: 6px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dsh-cqa-list-item {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 6px 8px;\n border-radius: 8px;\n background: var(--dsw-alias-interactive-bg-hover);\n}\n/* A hidden or disabled action stays legible: it is managed here, not removed. */\n.dsh-cqa-list-item[data-quick-action-hidden] .dsh-cqa-list-head,\n.dsh-cqa-list-item[data-quick-action-hidden] .dsh-cqa-list-text {\n opacity: 0.6;\n}\n.dsh-cqa-list-head {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n min-width: 0;\n font-size: 13px;\n line-height: 20px;\n}\n.dsh-cqa-list-text {\n min-width: 0;\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary);\n font-family: var(--ds-font-family-code);\n font-size: 11px;\n line-height: 16px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.dsh-cqa-list-controls {\n display: flex;\n align-items: center;\n gap: 4px;\n flex-wrap: wrap;\n}\n\n.dsh-cqa-form {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 6px 0 0;\n border-top: 0.5px solid var(--dsw-alias-border-l1);\n}\n.dsh-cqa-form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n padding-top: 6px;\n}\n";
|
|
30
|
+
/**
|
|
31
|
+
* Install the stylesheet once per document and return its disposer, so the
|
|
32
|
+
* Client fiber owns it like every other registration (spec 7.3).
|
|
33
|
+
*
|
|
34
|
+
* The holder count lives on the tag rather than in this module, because a hot
|
|
35
|
+
* reload runs two bundle instances at once: the new fiber installs before the
|
|
36
|
+
* old one unloads, and each has its own module scope. Counting in the DOM is
|
|
37
|
+
* what keeps the surviving instance's styles from being removed underneath it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function installQuickActionStyles(): () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public type entry: the shared Quick Action data contract — action and Settings
|
|
3
|
+
* V1 shapes, Preset Catalog and projection shapes, validation issue vocabulary
|
|
4
|
+
* and the Settings mutation plan shapes.
|
|
5
|
+
*
|
|
6
|
+
* Types only. The runtime rules that go with them (validation, catalog assembly,
|
|
7
|
+
* decoding, normalization, projection, mutation planning) stay internal to the
|
|
8
|
+
* package: Host and Client import them from `src/model/`, and whether any of them
|
|
9
|
+
* becomes a published runtime export is part of the release-surface decision.
|
|
10
|
+
*/
|
|
11
|
+
export type * from './model/index.js';
|
package/lib/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-quick-actions",
|
|
3
|
+
"version": "0.1.0-rc.3",
|
|
4
|
+
"description": "Persistent Quick Actions for the DSH message composer",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "lib/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/types/index.d.ts",
|
|
12
|
+
"default": "./lib/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./client": {
|
|
15
|
+
"types": "./lib/types/client/index.d.ts",
|
|
16
|
+
"default": "./lib/client.js"
|
|
17
|
+
},
|
|
18
|
+
"./types": {
|
|
19
|
+
"types": "./lib/types/types.d.ts",
|
|
20
|
+
"default": "./lib/types.js"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"cordis.patch.yml",
|
|
26
|
+
"lib/index.js",
|
|
27
|
+
"lib/types.js",
|
|
28
|
+
"lib/client.js",
|
|
29
|
+
"lib/client.js.map",
|
|
30
|
+
"lib/types/**/*.d.ts",
|
|
31
|
+
"README.md",
|
|
32
|
+
"README.en.md"
|
|
33
|
+
],
|
|
34
|
+
"dsh": {
|
|
35
|
+
"bundle": {
|
|
36
|
+
"patch": "./cordis.patch.yml"
|
|
37
|
+
},
|
|
38
|
+
"client": {
|
|
39
|
+
"platform": "web",
|
|
40
|
+
"inject": [
|
|
41
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
43
|
+
"@deepseek-ai/dsh-client-connection",
|
|
44
|
+
"@deepseek-ai/dsh-client-locale",
|
|
45
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
46
|
+
],
|
|
47
|
+
"external": [
|
|
48
|
+
"react",
|
|
49
|
+
"react/jsx-runtime",
|
|
50
|
+
"react-dom",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-primitives"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
57
|
+
"@deepseek-ai/dsh-client-connection": ">=0.1.5-rc.1",
|
|
58
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.5-rc.1",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-conversation": ">=0.1.5-rc.1",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-primitives": ">=0.1.5-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-renderer": ">=0.1.5-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.5-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-settings": ">=0.1.5-rc.1",
|
|
64
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
65
|
+
"react": "^18.3.1",
|
|
66
|
+
"react-dom": "^18.3.1"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
|
|
71
|
+
"@deepseek-ai/dsh-settings": "^0.1.5-rc.1",
|
|
72
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
73
|
+
"@types/react": "~18.3.31",
|
|
74
|
+
"@types/react-dom": "~18.3.7",
|
|
75
|
+
"react": "^18.3.1",
|
|
76
|
+
"react-dom": "^18.3.1",
|
|
77
|
+
"@dsh-plugins/dsh-client-bundle": "0.0.0"
|
|
78
|
+
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"build": "node --eval \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsc -b && tsdown",
|
|
81
|
+
"watch:client": "tsdown --watch"
|
|
82
|
+
}
|
|
83
|
+
}
|