@webx-ui/module-admin 0.15.0 → 0.16.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.
@@ -0,0 +1,25 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { ScreenModel } from '@webx-ui/schema';
3
+ /**
4
+ * What a record's editor knows about its address and a described screen cannot carry.
5
+ *
6
+ * The address of a service, a category, an article is the module's prefix and the record's slug.
7
+ * The slug is a field of the screen; the prefix is configuration the editor was handed with the
8
+ * record, and the address the site answers at right now is the registry's. `wx-slug` needs all
9
+ * three to print the whole address and to warn before it moves — so the page that hosts the
10
+ * screen provides them, the same way it provides the preview to `wx-blocks`.
11
+ */
12
+ export interface RecordAddress {
13
+ /** The values of the screen as they are right now, edits included. */
14
+ values: Ref<ScreenModel>;
15
+ /** Where the module's addresses start: `services`, `''` for the root, `null` for none at all. */
16
+ prefix: Ref<string | null>;
17
+ /** The address the registry holds for the record in this language, without a leading slash. */
18
+ path: Ref<string | null | undefined>;
19
+ /** "The address is changing" — in the module's words. */
20
+ moving: () => string;
21
+ }
22
+ export declare const recordAddressKey: InjectionKey<RecordAddress>;
23
+ export declare function provideRecordAddress(address: RecordAddress): void;
24
+ /** The editor above this field, or `null` outside one — a demo, a test, a stray screen. */
25
+ export declare function useRecordAddress(): RecordAddress | null;
@@ -3,7 +3,7 @@ import { ScreenModel } from '@webx-ui/schema';
3
3
  import { CategoryRow } from './types';
4
4
  /**
5
5
  * What the category editor knows and the nodes of its screen do not — the same seam the article
6
- * editor has. `wx-category-slug` prints the whole address, and the prefix of the module is
6
+ * editor has. `wx-category-slug` (`wx-slug`) prints the whole address, and the prefix of the module is
7
7
  * configuration the editor was handed with the record, not something a description can carry.
8
8
  */
9
9
  export interface CategoryEditorContext {
package/dist/index.d.ts CHANGED
@@ -35,4 +35,7 @@ export { default as WxCategoriesPage } from './categories/CategoriesPage';
35
35
  export { default as WxCategoryCreateDialog } from './categories/CategoryCreateDialog';
36
36
  export { default as WxCategoryEditorPage } from './categories/CategoryEditorPage';
37
37
  export { default as WxCategoriesField } from './categories/CategoriesField';
38
- export { default as WxCategorySlug } from './categories/CategorySlug';
38
+ export { default as WxSlugField } from './SlugField';
39
+ /** The shared address field under the name it was released with. */
40
+ export { default as WxCategorySlug } from './SlugField';
41
+ export { provideRecordAddress, recordAddressKey, useRecordAddress, type RecordAddress, } from './address';