aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocComponent.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-04-09 14:55:28 -0400
committerbobzel <zzzman@gmail.com>2025-04-09 14:55:28 -0400
commit2d382a1dd28aa5aae22669988475e5721435b738 (patch)
treef432634a1d02959a2795f3a6d81f9a7ec54140e3 /src/client/views/DocComponent.tsx
parent4f236271c39380f15409b8fb38b2f6e2bae8df9f (diff)
more color template fixes.
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r--src/client/views/DocComponent.tsx17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx
index b8b70d9d2..45c80c6f7 100644
--- a/src/client/views/DocComponent.tsx
+++ b/src/client/views/DocComponent.tsx
@@ -19,6 +19,7 @@ import { FieldViewProps } from './nodes/FieldView';
* */
export interface DocComponentProps {
Document: Doc;
+ TemplateDataDocument?: Doc;
LayoutTemplate?: () => Opt<Doc>;
LayoutTemplateString?: string;
}
@@ -53,8 +54,8 @@ export function DocComponent<P extends DocComponentProps>() {
/**
* Whether the doc is a sub-componentn of a compound template doc.
*/
- get isTemplate() {
- return this.rootDoc !== this.layoutDoc;
+ get isTemplateForField() {
+ return this.rootDoc !== this.layoutDoc && this._props.TemplateDataDocument;
}
/**
* This is the document being rendered by the React component. In the
@@ -117,12 +118,6 @@ export function ViewBoxBaseComponent<P extends FieldViewProps>() {
return DocCast(this.Document.rootDocument, this.Document);
}
/**
- * Whether the doc is a sub-componentn of a compound template doc.
- */
- get isTemplate() {
- return this.rootDoc !== this.layoutDoc;
- }
- /**
* This is the document being rendered by the React component. In the
* case of a compound template, this will be the expanded template Doc
* that represents the component of the compound Doc being rendered.
@@ -197,12 +192,6 @@ export function ViewBoxAnnotatableComponent<P extends FieldViewProps>() {
return DocCast(this.Document.rootDocument, this.Document);
}
/**
- * Whether the doc is a sub-componentn of a compound template doc.
- */
- get isTemplate() {
- return this.rootDoc !== this.layoutDoc;
- }
- /**
* This is the document being rendered. It may be a template so it may or may no inherit from the data doc.
*/
@computed get layoutDoc() {