@malloydata/render 0.0.369 → 0.0.371
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/module/api/plugin-types.d.ts +32 -5
- package/dist/module/component/renderer-validation-specs.d.ts +2 -0
- package/dist/module/component/tag-configs.d.ts +1 -1
- package/dist/module/index.mjs +6661 -6594
- package/dist/module/index.umd.js +42 -42
- package/dist/module/render-field-metadata.d.ts +7 -7
- package/package.json +5 -5
|
@@ -8,6 +8,11 @@ export interface RenderProps {
|
|
|
8
8
|
field: Field;
|
|
9
9
|
customProps?: Record<string, unknown>;
|
|
10
10
|
}
|
|
11
|
+
export interface RendererValidationSpec {
|
|
12
|
+
readonly renderer: string;
|
|
13
|
+
readonly ownedPaths?: string[][];
|
|
14
|
+
readonly childOwnedPaths?: string[][];
|
|
15
|
+
}
|
|
11
16
|
interface BaseRenderPluginInstance<TMetadata = unknown> {
|
|
12
17
|
readonly name: string;
|
|
13
18
|
readonly field: Field;
|
|
@@ -17,11 +22,9 @@ interface BaseRenderPluginInstance<TMetadata = unknown> {
|
|
|
17
22
|
beforeRender?(metadata: RenderMetadata, options: GetResultMetadataOptions): void;
|
|
18
23
|
getStyleOverrides?(): Record<string, string>;
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* don't produce false-positive "unknown tag" warnings when the
|
|
24
|
-
* component hasn't rendered yet (e.g. virtualized off-screen).
|
|
25
|
+
* Legacy compatibility for plugins that still declare self-owned paths
|
|
26
|
+
* from the instance. New code should use factory.getValidationSpec().
|
|
27
|
+
* @deprecated Use RenderPluginFactory.getValidationSpec() instead.
|
|
25
28
|
*/
|
|
26
29
|
getDeclaredTagPaths?(): string[][];
|
|
27
30
|
}
|
|
@@ -44,6 +47,30 @@ export interface CoreVizPluginMethods {
|
|
|
44
47
|
export type CoreVizPluginInstance<TMetadata = unknown> = SolidJSRenderPluginInstance<TMetadata> & CoreVizPluginMethods;
|
|
45
48
|
export interface RenderPluginFactory<TInstance extends RenderPluginInstance = RenderPluginInstance> {
|
|
46
49
|
readonly name: string;
|
|
50
|
+
/**
|
|
51
|
+
* IMPORTANT: Declare the tags this renderer OWNS, not every tag it might
|
|
52
|
+
* ever read.
|
|
53
|
+
*
|
|
54
|
+
* Own a tag here if this renderer is the authority for its meaning:
|
|
55
|
+
* - the tag is only meaningful when this renderer is active
|
|
56
|
+
* - this renderer is responsible for validating it
|
|
57
|
+
* - this renderer should suppress "unknown render tag" warnings for it
|
|
58
|
+
*
|
|
59
|
+
* This applies to:
|
|
60
|
+
* - tags on the renderer field itself
|
|
61
|
+
* - context-sensitive tags on child fields
|
|
62
|
+
*
|
|
63
|
+
* Do NOT declare globally meaningful field tags just because this renderer
|
|
64
|
+
* happens to read them during implementation. Examples: `label`, `hidden`,
|
|
65
|
+
* `description`, `column`.
|
|
66
|
+
*
|
|
67
|
+
* Rule:
|
|
68
|
+
* - if the tag would be meaningless without this renderer, declare it here
|
|
69
|
+
* - if the tag is meaningful independently of this renderer, do not
|
|
70
|
+
*
|
|
71
|
+
* Think in terms of semantic ownership, not literal runtime reads.
|
|
72
|
+
*/
|
|
73
|
+
getValidationSpec?(): RendererValidationSpec;
|
|
47
74
|
matches(field: Field, fieldTag: Tag, fieldType: FieldType): boolean;
|
|
48
75
|
create(field: Field, pluginOptions?: unknown, modelTag?: Tag): TInstance;
|
|
49
76
|
}
|
|
@@ -69,7 +69,7 @@ export interface DashboardNestConfig {
|
|
|
69
69
|
* Run the appropriate tag resolver for a field based on its renderAs type
|
|
70
70
|
* and store the result on the field. Called during registerFields().
|
|
71
71
|
*
|
|
72
|
-
* Also resolves cross-cutting tag properties (label, column
|
|
72
|
+
* Also resolves cross-cutting tag properties (label, column)
|
|
73
73
|
* for ALL fields, ensuring all tag access happens at setup time.
|
|
74
74
|
* Components use the resolved configs instead of reading tags directly.
|
|
75
75
|
*/
|