@kardalum/plugin-sdk 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.
Files changed (164) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/admin-section-registry.d.ts +14 -5
  3. package/dist/admin-section-registry.js +14 -4
  4. package/dist/capabilities.js +0 -3
  5. package/dist/host-entry.d.ts +1 -1
  6. package/dist/host-entry.js +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +8 -8
  9. package/dist/license-verdict-keys.d.ts +4 -3
  10. package/dist/license-verdict-keys.js +4 -7
  11. package/dist/manifest-entry.d.ts +2 -2
  12. package/dist/manifest-entry.js +1 -1
  13. package/dist/manifest-schema.d.ts +51 -62
  14. package/dist/manifest-schema.js +97 -249
  15. package/dist/manifest.d.ts +41 -73
  16. package/dist/manifest.js +13 -36
  17. package/dist/plugin-screen-context.d.ts +11 -1
  18. package/dist/richtext/block-panel.js +2 -2
  19. package/dist/richtext/insert-menu.js +1 -1
  20. package/dist/richtext/style-listbox.js +4 -4
  21. package/dist/tokens/tokens.css +1 -0
  22. package/dist/tokens/tokens.json +2 -1
  23. package/dist/type-equality.d.ts +2 -0
  24. package/dist/type-equality.js +1 -0
  25. package/dist/views/html-view.js +1 -1
  26. package/dist/views/rich-text-view.js +1 -1
  27. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
  28. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +32 -1
  29. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +22 -1
  30. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +50 -15
  31. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
  32. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
  33. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +6 -5
  34. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
  35. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
  36. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
  37. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
  38. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +41 -5
  39. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +23 -9
  40. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +36 -20
  41. package/node_modules/@kardalum/api-schemas/dist/index.js +21 -11
  42. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
  43. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
  44. package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
  45. package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
  46. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +101 -62
  47. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +15 -4
  48. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +6 -2
  49. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
  50. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +1 -16
  51. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +3 -19
  52. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -15
  53. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
  54. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
  55. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +1 -1
  56. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +97 -85
  57. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +35 -68
  58. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
  59. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
  60. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +9 -2
  61. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +22 -7
  62. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +13 -6
  63. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +7 -1
  64. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +4 -3
  65. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +1 -1
  66. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +14 -0
  67. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
  68. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
  69. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
  70. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +2 -0
  71. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
  72. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +74 -0
  73. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +132 -0
  74. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
  75. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
  76. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +12 -3
  77. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +11 -0
  78. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +7 -0
  79. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +11 -2
  80. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +21 -3
  81. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
  82. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
  83. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +6 -6
  84. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +44 -25
  85. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +187 -48
  86. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +15 -3
  87. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +14 -0
  88. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  89. package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
  90. package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
  91. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +105 -1
  92. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +43 -3
  93. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +30 -2
  94. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +19 -5
  95. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
  96. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
  97. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +4 -0
  98. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +3 -0
  99. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +19 -0
  100. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +22 -0
  101. package/node_modules/@kardalum/api-schemas/package.json +2 -2
  102. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
  103. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
  104. package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
  105. package/node_modules/@kardalum/design-tokens/dist/tokens.js +3 -0
  106. package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
  107. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -0
  108. package/node_modules/@kardalum/plugin-package/README.md +4 -1
  109. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +6 -21
  110. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +13 -8
  111. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
  112. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +9 -14
  113. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
  114. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
  115. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
  116. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
  117. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
  118. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
  119. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +5 -0
  120. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +60 -0
  121. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
  122. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
  123. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
  124. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
  125. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
  126. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
  127. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
  128. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
  129. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
  130. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
  131. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
  132. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
  133. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
  134. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
  135. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
  136. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +133 -0
  137. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
  138. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
  139. package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
  140. package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
  141. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +6 -0
  142. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +158 -0
  143. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
  144. package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
  145. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
  146. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
  147. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
  148. package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
  149. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +9 -2
  150. package/node_modules/@kardalum/plugin-package/dist/index.js +7 -2
  151. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.d.ts +5 -0
  152. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
  153. package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +1 -0
  154. package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +1 -0
  155. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +21 -3
  156. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +37 -9
  157. package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
  158. package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
  159. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
  160. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
  161. package/node_modules/@kardalum/plugin-package/package.json +4 -2
  162. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +2 -2
  163. package/node_modules/@kardalum/ui/package.json +1 -1
  164. package/package.json +6 -6
@@ -1,7 +1,8 @@
1
1
  import type { ComponentType } from "react";
2
- import type { CreateDocumentTypeRequest, PluginDocsPage, PluginInstallDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
2
+ import type { CreateDocumentTypeRequest, PluginDocsPage, PluginInstallDeclaration, PluginLabel, ResolvedInstallAnswers } from "@kardalum/api-schemas";
3
3
  export type { InstallChoice, InstallOption, InstallStep, PluginInstallDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
4
4
  import type { ThemeTokenOverrides } from "@kardalum/design-tokens";
5
+ import { VIEW_BEARING_CONTRIBUTIONS, declaresClientBundle } from "@kardalum/plugin-package/reference";
5
6
  import type { ZodType } from "zod";
6
7
  import type { DataTypePlugin } from "./data-type-plugin.js";
7
8
  import type { BUILT_IN_RAIL_SECTIONS } from "./manifest-schema.js";
@@ -19,13 +20,13 @@ export type PluginType = "datatype" | "section" | "template" | "theme" | "integr
19
20
  /**
20
21
  * Databases a plugin can declare support for. Deliberately NOT
21
22
  * db-adapter's DatabaseDialect: that union includes 'mock' (the in-memory
22
- * test adapter), which no plugin may target — and the SDK is a published
23
+ * test adapter), which no plugin may target, and the SDK is a published
23
24
  * package that must not depend on the unpublished adapter internals.
24
25
  */
25
26
  export type DatabaseDialect = "postgresql" | "mysql" | "sqlite" | "mssql" | "mongodb";
26
27
  /**
27
28
  * How the plugin stores data and where it can run. Required on every
28
- * manifest (plugin-sdk.md) — the marketplace pre-filters by the site's
29
+ * manifest (plugin-sdk.md): the marketplace pre-filters by the site's
29
30
  * active database and install is blocked with a clear reason, never a
30
31
  * silent failure.
31
32
  */
@@ -41,7 +42,7 @@ export interface DatabaseCompatibility {
41
42
  storageType: "simple" | "structured";
42
43
  supported: DatabaseDialect[];
43
44
  /** Optional human-readable reason per UNSUPPORTED dialect (shown on the
44
- * blocked-install screen) — hence Partial: supported dialects carry no
45
+ * blocked-install screen), hence Partial: supported dialects carry no
45
46
  * reason. */
46
47
  unsupportedReason?: Partial<Record<DatabaseDialect, string>>;
47
48
  }
@@ -118,8 +119,8 @@ export interface PluginMigrationHooks {
118
119
  validateMigration?: (from: DatabaseDialect, to: DatabaseDialect) => PluginMigrationValidation | Promise<PluginMigrationValidation>;
119
120
  }
120
121
  /** The events a plugin can hook. The hook engine (S159) actually FIRES
121
- * only three of these — content:afterPublish (including rollbacks),
122
- * content:afterTrash, content:afterRestore — with the
122
+ * only three of these: content:afterPublish (including rollbacks),
123
+ * content:afterTrash, content:afterRestore, with the
123
124
  * ContentLifecycleHookPayload shape declared below; every other event in
124
125
  * this catalog is declared for forward compatibility and stays inert. */
125
126
  export type HookEvent = "content:beforeSave" | "content:afterSave" | "content:beforePublish" | "content:afterPublish" | "content:afterTrash" | "content:afterRestore" | "content:beforeDelete" | "media:afterUpload" | "user:afterLogin" | "api:beforeResponse";
@@ -144,8 +145,12 @@ export type HookHandler = (payload: unknown, context?: PluginHookContext) => voi
144
145
  export type PluginHooks = Partial<Record<HookEvent, HookHandler>>;
145
146
  /** A slot's label: a map of language code to text, `en` required (spec D5).
146
147
  * Each key is a language code such as `en`, `de` or `pt-BR`. The admin
147
- * shows the active language's text, else English; `slotLabel` is the one
148
- * place that choice is made. */
148
+ * shows the active language's text, else English; `resolveLabel` in
149
+ * @kardalum/api-schemas is the one place that choice is made (S311), and
150
+ * `slotLabel` is it for a map. Since S311 the display names of the other
151
+ * surfaces (an action's label, a role's, a widget's or a scheduled task's
152
+ * name, and the rest typed `PluginLabel` below) take the same map or a
153
+ * plain string. */
149
154
  export interface SlotLabel {
150
155
  en: string;
151
156
  [locale: string]: string;
@@ -203,7 +208,7 @@ export interface BuiltInRailEntryContribution extends RailEntryContribution {
203
208
  }
204
209
  export interface DashboardWidgetContribution {
205
210
  id: string;
206
- name: string;
211
+ name: PluginLabel;
207
212
  view: ComponentType;
208
213
  /** The named permission action a subject must hold to reach this
209
214
  * (S270, theme G1). Required: a contribution that declares no action
@@ -268,7 +273,7 @@ export interface ApiRouteContribution {
268
273
  * server's OpenAPI documents. */
269
274
  response?: Record<string, ZodType>;
270
275
  };
271
- /** Third argument added Month 8, Session 90 — the first server-side
276
+ /** Third argument added Month 8, Session 90, the first server-side
272
277
  * consumer needing privileged host access. Existing two-argument (or
273
278
  * fewer) handlers remain perfectly valid: TypeScript allows a function
274
279
  * with fewer declared parameters to satisfy a type expecting more. */
@@ -284,7 +289,7 @@ export interface ApiRouteContribution {
284
289
  }
285
290
  export interface ScheduledTaskContribution {
286
291
  id: string;
287
- name: string;
292
+ name: PluginLabel;
288
293
  /** Standard 5-field cron expression. */
289
294
  cron: string;
290
295
  run: (context?: PluginTaskContext) => void | Promise<void>;
@@ -293,55 +298,19 @@ export interface ScheduledTaskContribution {
293
298
  * contract firms up when the BullMQ media pipeline lands. */
294
299
  export interface MediaProcessorContribution {
295
300
  id: string;
296
- name: string;
301
+ name: PluginLabel;
297
302
  process: (file: unknown) => unknown | Promise<unknown>;
298
303
  }
299
- export interface SettingsPageContribution {
300
- id: string;
301
- name: string;
302
- view: ComponentType;
303
- /** The named permission action a subject must hold to reach this
304
- * (S270, theme G1). Required: a contribution that declares no action
305
- * would be a gate nobody chose, and omission is how a permission
306
- * silently loosens. Must be prefixed with this plugin's own id, so one
307
- * plugin cannot declare an action in another's namespace or in core's. */
308
- action: string;
309
- }
310
- export interface ContentTreeActionContribution {
311
- id: string;
312
- label: string;
313
- onSelect: (nodeId: string) => void | Promise<void>;
314
- /** The named permission action a subject must hold to reach this
315
- * (S270, theme G1). Required: a contribution that declares no action
316
- * would be a gate nobody chose, and omission is how a permission
317
- * silently loosens. Must be prefixed with this plugin's own id, so one
318
- * plugin cannot declare an action in another's namespace or in core's. */
319
- action: string;
320
- }
321
- /** A button in the rich-text editor's toolbar. TipTap wiring comes with
322
- * the first consumer. */
323
- export interface EditorToolbarContribution {
324
- id: string;
325
- label: string;
326
- icon: string;
327
- onClick: () => void | Promise<void>;
328
- /** The named permission action a subject must hold to reach this
329
- * (S270, theme G1). Required: a contribution that declares no action
330
- * would be a gate nobody chose, and omission is how a permission
331
- * silently loosens. Must be prefixed with this plugin's own id, so one
332
- * plugin cannot declare an action in another's namespace or in core's. */
333
- action: string;
334
- }
335
304
  /** A service an integration plugin exposes for other plugins to consume
336
305
  * (e.g. a Stripe client). Shape intentionally opaque until the
337
306
  * cross-plugin service registry exists. */
338
307
  export interface ExposedServiceContribution {
339
308
  id: string;
340
- name: string;
309
+ name: PluginLabel;
341
310
  service: unknown;
342
311
  }
343
312
  /** A ready-made frontend starter shipped alongside a plugin (e.g. the
344
- * Commerce plugin's "Online Store" Next.js starter) — one marketplace
313
+ * Commerce plugin's "Online Store" Next.js starter), one marketplace
345
314
  * listing, working site immediately. Packaging lands Month 13. */
346
315
  export interface BundledTemplateContribution {
347
316
  name: string;
@@ -349,14 +318,14 @@ export interface BundledTemplateContribution {
349
318
  /** Where the starter's source lives until marketplace packaging exists. */
350
319
  repository?: string;
351
320
  }
352
- /** One render template a plugin ships under its own `templates/` dir —
353
- * per S192 §8 ("a new `templates` contribution — template files declared
321
+ /** One render template a plugin ships under its own `templates/` dir,
322
+ * per S192 §8 ("a new `templates` contribution: template files declared
354
323
  * with alias/kind and, for pages, which contributed document type they
355
324
  * render"). Any plugin may declare templates (S268): a `page` kind entry
356
325
  * may only name a document type this same manifest declares. */
357
326
  export interface TemplateContribution {
358
327
  /** Relative path under the plugin's `templates/` directory, forward
359
- * slashes, ending in `.liquid` — this is the file S192 §5 says the
328
+ * slashes, ending in `.liquid`: this is the file S192 §5 says the
360
329
  * developer edits and the mirror-on-edit versioning tracks. */
361
330
  file: string;
362
331
  name: string;
@@ -365,7 +334,7 @@ export interface TemplateContribution {
365
334
  alias: string;
366
335
  kind: "page" | "layout" | "partial";
367
336
  /** `page` kind only: a NAME from THIS manifest's own `documentTypes`
368
- * contribution — the document type this page template renders.
337
+ * contribution: the document type this page template renders.
369
338
  * Optional: a catch-all-ish page template with no specific type is
370
339
  * legal (S193 allows a null `documentTypeId`). Forbidden on
371
340
  * `layout`/`partial` entries, which never render a document type. */
@@ -380,7 +349,7 @@ export interface SerializerContext {
380
349
  publishedAt: string | null;
381
350
  version: number;
382
351
  };
383
- /** SERIALIZED field data — contributions run after core serialization. */
352
+ /** SERIALIZED field data: contributions run after core serialization. */
384
353
  data: Record<string, unknown>;
385
354
  documentType: {
386
355
  id: string;
@@ -388,7 +357,7 @@ export interface SerializerContext {
388
357
  };
389
358
  }
390
359
  export interface CustomFormatContribution {
391
- /** Plugin-scoped name, /^[a-z0-9-]+$/ — addressed as `<pluginId>:<name>`. */
360
+ /** Plugin-scoped name, /^[a-z0-9-]+$/, addressed as `<pluginId>:<name>`. */
392
361
  name: string;
393
362
  build: (context: SerializerContext) => unknown | Promise<unknown>;
394
363
  }
@@ -409,9 +378,6 @@ export interface PluginContributions {
409
378
  hooks?: PluginHooks;
410
379
  scheduledTasks?: ScheduledTaskContribution[];
411
380
  mediaProcessors?: MediaProcessorContribution[];
412
- settingsPages?: SettingsPageContribution[];
413
- contentTreeActions?: ContentTreeActionContribution[];
414
- editorToolbar?: EditorToolbarContribution[];
415
381
  exposedServices?: ExposedServiceContribution[];
416
382
  serializers?: SerializerContribution;
417
383
  /** Document types the plugin provisions at install: the creation shape
@@ -439,10 +405,10 @@ export interface PluginContributions {
439
405
  /**
440
406
  * The contributions that put code in the browser, and so the ones that
441
407
  * make a plugin ship a client bundle (S267 section 5, implemented by
442
- * S268 Task 3). `dataTypes`, `adminSections`, `railEntries` (S280),
443
- * `dashboardWidgets` and `settingsPages` carry React views; `contentTreeActions` and
444
- * `editorToolbar` carry client callbacks (`onSelect`, `onClick`), which
445
- * is just as much browser code even though neither has a `view` key.
408
+ * S268 Task 3). `dataTypes`, `adminSections`, `railEntries` (S280) and
409
+ * `dashboardWidgets` carry React views. S313b retired `settingsPages`,
410
+ * `contentTreeActions` and `editorToolbar`, which no admin screen hosted;
411
+ * the last two return when a host and an editor-handle API are designed.
446
412
  *
447
413
  * Everything else is absent on purpose: `apiRoutes`, `hooks`,
448
414
  * `scheduledTasks`, `mediaProcessors` and `serializers` run on the
@@ -454,7 +420,7 @@ export interface PluginContributions {
454
420
  * than that list was, not merely equivalent: a plugin listed as
455
421
  * `section` with no views had to ship a remoteEntry.js it did not have.
456
422
  */
457
- export declare const VIEW_BEARING_CONTRIBUTIONS: readonly ["dataTypes", "adminSections", "railEntries", "dashboardWidgets", "settingsPages", "contentTreeActions", "editorToolbar"];
423
+ export { VIEW_BEARING_CONTRIBUTIONS };
458
424
  export type ViewBearingContribution = (typeof VIEW_BEARING_CONTRIBUTIONS)[number];
459
425
  /**
460
426
  * Whether a manifest's declared contributions require a client bundle:
@@ -483,9 +449,9 @@ export type ViewBearingContribution = (typeof VIEW_BEARING_CONTRIBUTIONS)[number
483
449
  * 'hasClientBundle'", before it can decide anything. The old name is
484
450
  * gone rather than aliased: a name that outlives its meaning is how these
485
451
  * get recombined later. A caller passing a string to THIS name is a
486
- * compile error against the signature below.
452
+ * compile error against the signature in plugin-package.
487
453
  */
488
- export declare function declaresClientBundle(contributions: PluginContributions | Record<string, unknown> | null | undefined): boolean;
454
+ export { declaresClientBundle };
489
455
  /** S292: what onInstall is told. */
490
456
  export interface PluginInstallContext {
491
457
  /** The install's answers with every default filled: what the operator
@@ -532,7 +498,7 @@ export interface PluginManifestBase {
532
498
  /**
533
499
  * Marketplace verification hash. Optional BY DESIGN, not oversight:
534
500
  * per the Trust model, sideloaded/local dev plugins are unsigned by
535
- * definition (Tier 2 'unverified') — only marketplace-signed plugins
501
+ * definition (Tier 2 'unverified'): only marketplace-signed plugins
536
502
  * carry one. Signing is authenticity, not a sandbox; the safety layer
537
503
  * is identical for both tiers.
538
504
  */
@@ -543,7 +509,7 @@ export interface PluginManifestBase {
543
509
  pluginDependencies?: string[];
544
510
  databaseCompatibility: DatabaseCompatibility;
545
511
  assertions?: PluginAssertions;
546
- /** DB changes applied on install (through plugin storage — never raw
512
+ /** DB changes applied on install (through plugin storage, never raw
547
513
  * SQL). */
548
514
  migrations?: PluginMigration[];
549
515
  onInstall?: (ctx: PluginInstallContext) => void | Promise<void>;
@@ -561,11 +527,13 @@ export interface PluginManifestBase {
561
527
  * names one of these, and each of these is named by at least one, so the
562
528
  * install screen shows exactly what installing adds to the permission
563
529
  * surface. Ids carry this plugin's prefix and have a label, because
564
- * nothing ever shows an operator a raw action string.
530
+ * nothing ever shows an operator a raw action string. A label is a string
531
+ * or a map of language code to text with `en` required (S311); the install
532
+ * stores the text of the site's default language.
565
533
  */
566
534
  actions?: Array<{
567
535
  id: string;
568
- label: string;
536
+ label: PluginLabel;
569
537
  }>;
570
538
  /**
571
539
  * Roles this plugin offers (S273). An offer is never applied unasked: the
@@ -577,15 +545,15 @@ export interface PluginManifestBase {
577
545
  */
578
546
  roles?: Array<{
579
547
  id: string;
580
- label: string;
548
+ label: PluginLabel;
581
549
  actions: string[];
582
550
  }>;
583
551
  /** S286: the plugin's docs pages, in reading order. Omit it and the
584
552
  * README is the one page (the overview). Which roles the marketplace
585
553
  * requires is derived from what the manifest declares, never listed
586
554
  * here: a "setup" page when the plugin has migrations, dependencies, a
587
- * price or document types; a "configuration" page when it has settings
588
- * pages. */
555
+ * price or document types. The "configuration" role stays declarable
556
+ * but is never required. */
589
557
  docs?: PluginDocsPage[];
590
558
  /** S291: the language the docs pages are written in, as a language code
591
559
  * such as "en", "de" or "pt-BR". Absent means English. The marketplace
package/dist/manifest.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { resolveLabel } from "@kardalum/api-schemas";
2
+ import { VIEW_BEARING_CONTRIBUTIONS, declaresClientBundle } from "@kardalum/plugin-package/reference";
1
3
  /**
2
4
  * The text of a slot's label for a locale: the locale as given, else its
3
5
  * primary subtag (`de-AT` reads `de`), else `en`, which every label carries.
@@ -5,25 +7,15 @@
5
7
  * case-insensitive and a label written `pt-BR` must answer `pt-br`.
6
8
  */
7
9
  export function slotLabel(label, locale) {
8
- const wanted = locale.toLowerCase();
9
- const primary = wanted.split("-")[0] ?? "";
10
- let primaryText;
11
- for (const [code, text] of Object.entries(label)) {
12
- const lower = code.toLowerCase();
13
- if (lower === wanted)
14
- return text;
15
- if (primaryText === undefined && primary !== "" && lower === primary)
16
- primaryText = text;
17
- }
18
- return primaryText ?? label.en;
10
+ return resolveLabel(label, locale);
19
11
  }
20
12
  /**
21
13
  * The contributions that put code in the browser, and so the ones that
22
14
  * make a plugin ship a client bundle (S267 section 5, implemented by
23
- * S268 Task 3). `dataTypes`, `adminSections`, `railEntries` (S280),
24
- * `dashboardWidgets` and `settingsPages` carry React views; `contentTreeActions` and
25
- * `editorToolbar` carry client callbacks (`onSelect`, `onClick`), which
26
- * is just as much browser code even though neither has a `view` key.
15
+ * S268 Task 3). `dataTypes`, `adminSections`, `railEntries` (S280) and
16
+ * `dashboardWidgets` carry React views. S313b retired `settingsPages`,
17
+ * `contentTreeActions` and `editorToolbar`, which no admin screen hosted;
18
+ * the last two return when a host and an editor-handle API are designed.
27
19
  *
28
20
  * Everything else is absent on purpose: `apiRoutes`, `hooks`,
29
21
  * `scheduledTasks`, `mediaProcessors` and `serializers` run on the
@@ -35,15 +27,10 @@ export function slotLabel(label, locale) {
35
27
  * than that list was, not merely equivalent: a plugin listed as
36
28
  * `section` with no views had to ship a remoteEntry.js it did not have.
37
29
  */
38
- export const VIEW_BEARING_CONTRIBUTIONS = [
39
- "dataTypes",
40
- "adminSections",
41
- "railEntries",
42
- "dashboardWidgets",
43
- "settingsPages",
44
- "contentTreeActions",
45
- "editorToolbar",
46
- ];
30
+ // S311: the list and the rule live in @kardalum/plugin-package (browser-safe,
31
+ // shared with the marketplace door and the CLI, imported at the top of this
32
+ // file); the SDK re-exports them.
33
+ export { VIEW_BEARING_CONTRIBUTIONS };
47
34
  /**
48
35
  * Whether a manifest's declared contributions require a client bundle:
49
36
  * whether a built artifact must contain a `remoteEntry.js`, and whether
@@ -71,16 +58,6 @@ export const VIEW_BEARING_CONTRIBUTIONS = [
71
58
  * 'hasClientBundle'", before it can decide anything. The old name is
72
59
  * gone rather than aliased: a name that outlives its meaning is how these
73
60
  * get recombined later. A caller passing a string to THIS name is a
74
- * compile error against the signature below.
61
+ * compile error against the signature in plugin-package.
75
62
  */
76
- export function declaresClientBundle(contributions) {
77
- if (contributions === null || typeof contributions !== "object")
78
- return false;
79
- const declared = contributions;
80
- return VIEW_BEARING_CONTRIBUTIONS.some((key) => {
81
- const value = declared[key];
82
- if (value === null || value === undefined)
83
- return false;
84
- return Array.isArray(value) ? value.length > 0 : true;
85
- });
86
- }
63
+ export { declaresClientBundle };
@@ -21,6 +21,9 @@ export type PluginTranslate = (key: string, values?: Record<string, string | num
21
21
  * - `kind: "rail"`: an entry the plugin adds to a built-in section's rail
22
22
  * (content, media, settings, users). `sectionId` is null, because the
23
23
  * section is not the plugin's; `entryId` is the entry's id.
24
+ * - `kind: "widget"`: a dashboard widget on the admin's Home page (S313b).
25
+ * `widgetId` is the widget's id; `sectionId` and `entryId` are null,
26
+ * because a widget belongs to no section.
24
27
  */
25
28
  export interface PluginScreenContext {
26
29
  pluginId: string;
@@ -28,6 +31,11 @@ export interface PluginScreenContext {
28
31
  kind: "section" | "sectionRail" | "rail";
29
32
  sectionId: string | null;
30
33
  entryId: string | null;
34
+ } | {
35
+ kind: "widget";
36
+ sectionId: null;
37
+ entryId: null;
38
+ widgetId: string;
31
39
  };
32
40
  /** The admin's active language, for formatting dates and numbers. A
33
41
  * screen's words come from `t`. */
@@ -40,7 +48,9 @@ export interface PluginScreenContext {
40
48
  * section's landing page. Anything else (a path such as `..`, another
41
49
  * plugin's URL, an id the section's rail does not declare) does nothing,
42
50
  * with a console warning in development. Always a no-op for a built-in
43
- * rail entry, whose section is not the plugin's.
51
+ * rail entry and for a dashboard widget, whose place is not the plugin's
52
+ * to move; a widget's navigate also prints a console warning in
53
+ * development, naming the plugin and the target.
44
54
  */
45
55
  navigate: (entryId: string | null) => void;
46
56
  }
@@ -161,7 +161,7 @@ export function BlockPanel({ editor, pos, partial, params }) {
161
161
  // editor, so this is a real guard, not defensive-for-its-own-sake.
162
162
  if (!editor.isDestroyed)
163
163
  editor.commands.focus();
164
- }, className: "flex max-h-[80vh] max-w-sm flex-col gap-0 p-0", children: [_jsxs(DialogHeader, { className: "border-b border-border-default px-4 py-3", children: [_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx(DialogTitle, { children: listing?.name ?? partial }), _jsxs("span", { className: "font-mono text-xs text-text-tertiary", children: ["partial: ", partial, ".liquid"] })] }), _jsx(DialogCloseButton, { "aria-label": "Close" })] }), _jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4", children: [_jsx(BlockParamFields, { listing: listing, listingsError: listingsError, params: params, onChange: updateParam }), _jsxs("p", { className: "rounded-md border border-border-default bg-background-subtle p-2 text-xs text-text-secondary", children: [_jsx("b", { className: "font-semibold text-text-primary", children: "Live preview." }), " This block is rendered by your own template on the server. What you see on the page is exactly what visitors will get."] })] }), _jsxs(DialogFooter, { className: "mt-0 justify-start border-t border-border-default p-4", children: [_jsx(Button, { type: "button", variant: "ghost", className: "text-danger-600 hover:text-danger-700", onClick: handleRemove, children: "Remove block" }), _jsx(Button, { type: "button", className: "ms-auto", onClick: moveSelectionPastBlock, children: "Done" })] })] }) }));
164
+ }, className: "flex max-h-[80vh] max-w-sm flex-col gap-0 p-0", children: [_jsxs(DialogHeader, { className: "border-b border-border-default px-4 py-3", children: [_jsxs("div", { className: "flex flex-col gap-px", children: [_jsx(DialogTitle, { children: listing?.name ?? partial }), _jsxs("span", { className: "font-mono text-xs text-text-tertiary", children: ["partial: ", partial, ".liquid"] })] }), _jsx(DialogCloseButton, { "aria-label": "Close" })] }), _jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4", children: [_jsx(BlockParamFields, { listing: listing, listingsError: listingsError, params: params, onChange: updateParam }), _jsxs("p", { className: "rounded-md border border-border-default bg-background-subtle p-2 text-xs text-text-secondary", children: [_jsx("b", { className: "font-semibold text-text-primary", children: "Live preview." }), " This block is rendered by your own template on the server. What you see on the page is exactly what visitors will get."] })] }), _jsxs(DialogFooter, { className: "mt-0 justify-start border-t border-border-default p-4", children: [_jsx(Button, { type: "button", variant: "ghost", className: "text-danger-600 hover:text-danger-700", onClick: handleRemove, children: "Remove block" }), _jsx(Button, { type: "button", className: "ms-auto", onClick: moveSelectionPastBlock, children: "Done" })] })] }) }));
165
165
  }
166
166
  // The chip's "preview ⤢" affordance (S197 mockup screen 3): fetches
167
167
  // POST /api/manage/v1/render/block for the block's CURRENT params and shows the
@@ -228,5 +228,5 @@ export function BlockPreviewPopover({ partial, params, anchorRect, onClose }) {
228
228
  if (event.key === "Escape")
229
229
  onClose();
230
230
  }
231
- return (_jsxs("div", { ref: popoverRef, role: "dialog", "aria-label": `Preview: ${partial}`, onKeyDown: handleKeyDownCapture, style: { position: "fixed", top: anchorRect.bottom + 4, left: anchorRect.left }, className: "z-20 w-80 rounded-md border border-border-default bg-background-elevated p-2 shadow-xl", children: [loading && _jsx("p", { className: "text-xs text-text-secondary", children: "Loading preview\u2026" }), error && _jsx("p", { className: "text-xs text-danger-600", children: error }), !loading && !error && (_jsx("iframe", { title: `Preview: ${partial}`, srcDoc: html ?? "", sandbox: "", className: "h-40 w-full rounded-sm border border-border-subtle bg-white" }))] }));
231
+ return (_jsxs("div", { ref: popoverRef, role: "dialog", "aria-label": `Preview: ${partial}`, onKeyDown: handleKeyDownCapture, style: { position: "fixed", top: anchorRect.bottom + 4, left: anchorRect.left }, className: "z-20 w-72 rounded-md border border-border-default bg-background-elevated p-2 shadow-xl", children: [loading && _jsx("p", { className: "text-xs text-text-secondary", children: "Loading preview\u2026" }), error && _jsx("p", { className: "text-xs text-danger-600", children: error }), !loading && !error && (_jsx("iframe", { title: `Preview: ${partial}`, srcDoc: html ?? "", sandbox: "", className: "h-44 w-full rounded-sm border border-border-subtle bg-background-elevated" }))] }));
232
232
  }
@@ -137,6 +137,6 @@ export function BlockInsertMenu({ onInsert, onClose }) {
137
137
  const selected = index === activeIndex;
138
138
  return (_jsxs("div", { ref: (el) => {
139
139
  optionRefs.current[index] = el;
140
- }, role: "option", "aria-selected": selected, tabIndex: selected ? 0 : -1, onFocus: () => setActiveIndex(index), onClick: () => commit(index), className: cn("flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1.5 text-sm outline-none", "focus-visible:ring-2 focus-visible:ring-primary-600", selected ? "bg-primary-100" : "text-text-primary hover:bg-background-hover"), children: [_jsx("span", { "aria-hidden": "true", className: "mt-0.5 text-text-secondary", children: "\u25EB" }), _jsxs("span", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium text-text-primary", children: listing.name }), _jsxs("span", { className: "text-xs text-text-secondary", children: [listing.alias, ".liquid", listing.params.length > 0 ? ` · ${listing.params.map((param) => param.key).join(", ")}` : ""] })] })] }, listing.alias));
140
+ }, role: "option", "aria-selected": selected, tabIndex: selected ? 0 : -1, onFocus: () => setActiveIndex(index), onClick: () => commit(index), className: cn("flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1 text-sm outline-none", "focus-visible:ring-2 focus-visible:ring-primary-600", selected ? "bg-primary-100" : "text-text-primary hover:bg-background-hover"), children: [_jsx("span", { "aria-hidden": "true", className: "mt-px text-text-secondary", children: "\u25EB" }), _jsxs("span", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium text-text-primary", children: listing.name }), _jsxs("span", { className: "text-xs text-text-secondary", children: [listing.alias, ".liquid", listing.params.length > 0 ? ` · ${listing.params.map((param) => param.key).join(", ")}` : ""] })] })] }, listing.alias));
141
141
  })] }));
142
142
  }
@@ -10,10 +10,10 @@ export function StyleListbox({ styles, loading, activeStyleKey, onSelect, onClea
10
10
  const [activeIndex, setActiveIndex] = useState(0);
11
11
  const optionRefs = useRef([]);
12
12
  if (loading) {
13
- return (_jsx("div", { role: "listbox", "aria-label": "Text styles", className: "min-w-40 p-2 text-xs text-text-secondary", children: "Loading\u2026" }));
13
+ return (_jsx("div", { role: "listbox", "aria-label": "Text styles", className: "min-w-44 p-2 text-xs text-text-secondary", children: "Loading\u2026" }));
14
14
  }
15
15
  if (styles.length === 0) {
16
- return (_jsx("div", { role: "listbox", "aria-label": "Text styles", className: "min-w-40 p-2 text-xs text-text-secondary", children: "No theme styles declared" }));
16
+ return (_jsx("div", { role: "listbox", "aria-label": "Text styles", className: "min-w-44 p-2 text-xs text-text-secondary", children: "No theme styles declared" }));
17
17
  }
18
18
  function focusIndex(index) {
19
19
  setActiveIndex(index);
@@ -60,10 +60,10 @@ export function StyleListbox({ styles, loading, activeStyleKey, onSelect, onClea
60
60
  return;
61
61
  }
62
62
  }
63
- return (_jsx("div", { role: "listbox", "aria-label": "Text styles", onKeyDown: handleKeyDown, className: "min-w-40 p-1", children: options.map((option, index) => {
63
+ return (_jsx("div", { role: "listbox", "aria-label": "Text styles", onKeyDown: handleKeyDown, className: "min-w-44 p-1", children: options.map((option, index) => {
64
64
  const selected = option.kind === "style" && option.style.key === activeStyleKey;
65
65
  return (_jsx("div", { ref: (el) => {
66
66
  optionRefs.current[index] = el;
67
- }, role: "option", "aria-selected": selected, tabIndex: index === activeIndex ? 0 : -1, onFocus: () => setActiveIndex(index), onClick: () => commit(index), className: cn("cursor-pointer rounded-sm px-2 py-1.5 text-sm outline-none", "focus-visible:ring-2 focus-visible:ring-primary-600", selected ? "bg-primary-100 text-primary-800" : "text-text-primary hover:bg-background-hover", option.kind === "clear" && "mt-1 border-t border-border-default pt-1.5 text-text-secondary"), children: option.kind === "style" ? option.style.label : "Clear style" }, option.kind === "style" ? option.style.key : "__clear__"));
67
+ }, role: "option", "aria-selected": selected, tabIndex: index === activeIndex ? 0 : -1, onFocus: () => setActiveIndex(index), onClick: () => commit(index), className: cn("cursor-pointer rounded-sm px-2 py-1 text-sm outline-none", "focus-visible:ring-2 focus-visible:ring-primary-600", selected ? "bg-primary-100 text-primary-800" : "text-text-primary hover:bg-background-hover", option.kind === "clear" && "mt-1 border-t border-border-default pt-1 text-text-secondary"), children: option.kind === "style" ? option.style.label : "Clear style" }, option.kind === "style" ? option.style.key : "__clear__"));
68
68
  }) }));
69
69
  }
@@ -102,6 +102,7 @@
102
102
  --color-footer-strong: #FFFFFF;
103
103
  --color-brand-tile: #113D5C;
104
104
  --color-brand-keep: #7CC0E8;
105
+ --color-canvas: #FFFFFF;
105
106
  --spacing-0: 0;
106
107
  --spacing-1: 0.25rem;
107
108
  --spacing-2: 0.5rem;
@@ -126,7 +126,8 @@
126
126
  "brand": {
127
127
  "tile": "#113D5C",
128
128
  "keep": "#7CC0E8"
129
- }
129
+ },
130
+ "canvas": "#FFFFFF"
130
131
  },
131
132
  "typography": {
132
133
  "fontFamily": {
@@ -0,0 +1,2 @@
1
+ export type Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;
2
+ export type Assignable<A, B> = [A] extends [B] ? true : false;
@@ -0,0 +1 @@
1
+ export {};
@@ -15,7 +15,7 @@ const HtmlCodeEditorLazy = lazy(() => import("./html-code-editor.js").then((modu
15
15
  // package's views deliberately hardcode English strings today, see
16
16
  // built-ins.tsx's TextReadOnlyView/ImageInputView precedent).
17
17
  function HtmlEditorFallback() {
18
- return (_jsx("div", { role: "status", "aria-label": "Loading code editor\u2026", children: _jsx("div", { "aria-hidden": "true", className: "h-40 w-full animate-pulse rounded-md border border-border-default bg-background-subtle" }) }));
18
+ return (_jsx("div", { role: "status", "aria-label": "Loading code editor\u2026", children: _jsx("div", { "aria-hidden": "true", className: "h-44 w-full animate-pulse rounded-md border border-border-default bg-background-subtle" }) }));
19
19
  }
20
20
  // The Trusted setting has no bearing on how this field is EDITED (both
21
21
  // modes get the same CodeMirror surface) — only on how it's RENDERED
@@ -154,7 +154,7 @@ function LinkPopover({ initialHref, hasLink, onApply, onRemove, onClose }) {
154
154
  if (href.trim())
155
155
  onApply(href.trim());
156
156
  }
157
- }, className: "mb-2 w-full rounded-md border border-border-default bg-background-elevated px-2 py-1 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600" }), _jsxs("div", { className: "flex justify-end gap-2", children: [hasLink && (_jsx("button", { type: "button", onClick: onRemove, className: "rounded-md px-2 py-1 text-xs text-danger-600 hover:bg-background-hover", children: "Remove link" })), _jsx("button", { type: "button", disabled: !href.trim(), onClick: () => onApply(href.trim()), className: "rounded-md bg-primary-600 px-2 py-1 text-xs font-medium text-white hover:bg-primary-700 disabled:opacity-50", children: "Apply" })] })] }));
157
+ }, className: "mb-2 w-full rounded-md border border-border-default bg-background-elevated px-2 py-1 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-600" }), _jsxs("div", { className: "flex justify-end gap-2", children: [hasLink && (_jsx("button", { type: "button", onClick: onRemove, className: "rounded-md px-2 py-1 text-xs text-danger-600 hover:bg-background-hover", children: "Remove link" })), _jsx("button", { type: "button", disabled: !href.trim(), onClick: () => onApply(href.trim()), className: "rounded-md bg-primary-600 px-2 py-1 text-xs font-medium text-text-inverse hover:bg-primary-700 disabled:opacity-50", children: "Apply" })] })] }));
158
158
  }
159
159
  // S197 Task 12: bubbles up so a mount that HAS routing (content-editor.tsx,
160
160
  // admin-ui) can navigate to /content/:id/edit-on-page — same "plain DOM
@@ -14,6 +14,11 @@ export declare const AssetTreeEntrySchema: z.ZodObject<{
14
14
  pluginId: z.ZodNullable<z.ZodString>;
15
15
  }, z.core.$strip>;
16
16
  export type AssetTreeEntry = z.infer<typeof AssetTreeEntrySchema>;
17
+ export declare const AssetTreeSkipSchema: z.ZodObject<{
18
+ path: z.ZodString;
19
+ reason: z.ZodString;
20
+ }, z.core.$strip>;
21
+ export type AssetTreeSkip = z.infer<typeof AssetTreeSkipSchema>;
17
22
  export declare const AssetTreeResponseSchema: z.ZodObject<{
18
23
  entries: z.ZodArray<z.ZodObject<{
19
24
  path: z.ZodString;
@@ -28,6 +33,10 @@ export declare const AssetTreeResponseSchema: z.ZodObject<{
28
33
  pluginId: z.ZodNullable<z.ZodString>;
29
34
  }, z.core.$strip>>;
30
35
  truncated: z.ZodBoolean;
36
+ skipped: z.ZodOptional<z.ZodArray<z.ZodObject<{
37
+ path: z.ZodString;
38
+ reason: z.ZodString;
39
+ }, z.core.$strip>>>;
31
40
  }, z.core.$strip>;
32
41
  export type AssetTreeResponse = z.infer<typeof AssetTreeResponseSchema>;
33
42
  export declare const AssetContentResponseSchema: z.ZodObject<{
@@ -87,3 +96,84 @@ export declare const AssetSyncReportSchema: z.ZodObject<{
87
96
  healed: z.ZodArray<z.ZodString>;
88
97
  }, z.core.$strip>;
89
98
  export type AssetSyncReport = z.infer<typeof AssetSyncReportSchema>;
99
+ export declare const AssetVersionParamsSchema: z.ZodObject<{
100
+ version: z.ZodCoercedNumber<unknown>;
101
+ }, z.core.$strip>;
102
+ export type AssetVersionParams = z.infer<typeof AssetVersionParamsSchema>;
103
+ export declare const AssetVersionListQuerySchema: z.ZodObject<{
104
+ cursor: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
105
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
106
+ path: z.ZodString;
107
+ }, z.core.$strip>;
108
+ export type AssetVersionListQuery = z.infer<typeof AssetVersionListQuerySchema>;
109
+ export declare const AssetVersionQuerySchema: z.ZodObject<{
110
+ path: z.ZodString;
111
+ }, z.core.$strip>;
112
+ export type AssetVersionQuery = z.infer<typeof AssetVersionQuerySchema>;
113
+ export declare const AssetVersionListResponseSchema: z.ZodObject<{
114
+ items: z.ZodArray<z.ZodObject<{
115
+ id: z.ZodString;
116
+ createdAt: z.ZodString;
117
+ source: z.ZodEnum<{
118
+ admin: "admin";
119
+ "plugin-install": "plugin-install";
120
+ "file-sync": "file-sync";
121
+ }>;
122
+ version: z.ZodNumber;
123
+ hash: z.ZodString;
124
+ assetId: z.ZodString;
125
+ }, z.core.$strict>>;
126
+ nextCursor: z.ZodNullable<z.ZodNumber>;
127
+ }, z.core.$strip>;
128
+ export type AssetVersionListResponse = z.infer<typeof AssetVersionListResponseSchema>;
129
+ export declare const AssetVersionResponseSchema: z.ZodObject<{
130
+ version: z.ZodObject<{
131
+ id: z.ZodString;
132
+ assetId: z.ZodString;
133
+ version: z.ZodNumber;
134
+ content: z.ZodString;
135
+ hash: z.ZodString;
136
+ source: z.ZodEnum<{
137
+ admin: "admin";
138
+ "plugin-install": "plugin-install";
139
+ "file-sync": "file-sync";
140
+ }>;
141
+ createdAt: z.ZodString;
142
+ }, z.core.$strict>;
143
+ }, z.core.$strip>;
144
+ export type AssetVersionResponse = z.infer<typeof AssetVersionResponseSchema>;
145
+ export declare const MakeAssetVersionCurrentRequestSchema: z.ZodObject<{
146
+ path: z.ZodString;
147
+ }, z.core.$strict>;
148
+ export type MakeAssetVersionCurrentRequest = z.infer<typeof MakeAssetVersionCurrentRequestSchema>;
149
+ export declare const RestoreAssetRequestSchema: z.ZodObject<{
150
+ path: z.ZodString;
151
+ id: z.ZodString;
152
+ }, z.core.$strict>;
153
+ export type RestoreAssetRequest = z.infer<typeof RestoreAssetRequestSchema>;
154
+ export declare const RestoreAssetResponseSchema: z.ZodObject<{
155
+ path: z.ZodString;
156
+ content: z.ZodString;
157
+ size: z.ZodNumber;
158
+ registered: z.ZodBoolean;
159
+ pluginId: z.ZodNullable<z.ZodString>;
160
+ version: z.ZodNullable<z.ZodNumber>;
161
+ foldedFile: z.ZodBoolean;
162
+ }, z.core.$strip>;
163
+ export type RestoreAssetResponse = z.infer<typeof RestoreAssetResponseSchema>;
164
+ export declare const AssetTrashListQuerySchema: z.ZodObject<{
165
+ cursor: z.ZodOptional<z.ZodString>;
166
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
167
+ }, z.core.$strip>;
168
+ export type AssetTrashListQuery = z.infer<typeof AssetTrashListQuerySchema>;
169
+ export declare const AssetTrashListResponseSchema: z.ZodObject<{
170
+ items: z.ZodArray<z.ZodObject<{
171
+ id: z.ZodString;
172
+ path: z.ZodString;
173
+ pluginId: z.ZodNullable<z.ZodString>;
174
+ currentVersion: z.ZodNumber;
175
+ deletedAt: z.ZodString;
176
+ }, z.core.$strict>>;
177
+ nextCursor: z.ZodNullable<z.ZodString>;
178
+ }, z.core.$strip>;
179
+ export type AssetTrashListResponse = z.infer<typeof AssetTrashListResponseSchema>;