@@ -10,6 +10,13 @@ import type {
1010import 'superdoc/style.css' ;
1111import './App.css' ;
1212
13+ const cellBorders = {
14+ top : { val : 'single' , size : 1 , color : '#000000' , style : 'solid' } ,
15+ right : { val : 'single' , size : 1 , color : '#000000' , style : 'solid' } ,
16+ bottom : { val : 'single' , size : 1 , color : '#000000' , style : 'solid' } ,
17+ left : { val : 'single' , size : 1 , color : '#000000' , style : 'solid' } ,
18+ } as const ;
19+
1320const availableFields : FieldDefinition [ ] = [
1421 { id : '1242142770' , label : 'Agreement Date' } ,
1522 { id : '1242142771' , label : 'User Name' , defaultValue : 'John Doe' } ,
@@ -20,6 +27,77 @@ const availableFields: FieldDefinition[] = [
2027 { id : '1242142776' , label : 'Signature' , mode : 'block' } ,
2128 { id : '1242142777' , label : 'Signer Name' , fieldType : 'signer' } ,
2229 { id : '1242142778' , label : 'Signer Table' , mode : 'block' , fieldType : 'signer' } ,
30+ {
31+ id : '1242142779' ,
32+ label : 'Sample Table' ,
33+ mode : 'block' ,
34+ fieldType : 'signer' ,
35+ presetContent : {
36+ html : '<table style="border-collapse: collapse; width: 100%;"><tr><th style="border: 1px solid #000;">Column A</th><th style="border: 1px solid #000;">Column B</th></tr><tr><td style="border: 1px solid #000;"></td><td style="border: 1px solid #000;"></td></tr></table>' ,
37+ } ,
38+ } ,
39+ {
40+ id : '1242142780' ,
41+ label : 'Sample List' ,
42+ mode : 'block' ,
43+ fieldType : 'signer' ,
44+ presetContent : {
45+ html : '<ul><li>First item</li><li>Second item</li><li>Third item</li></ul>' ,
46+ } ,
47+ } ,
48+ {
49+ id : '1242142781' ,
50+ label : 'Sample Table (JSON)' ,
51+ mode : 'block' ,
52+ fieldType : 'signer' ,
53+ presetContent : {
54+ json : {
55+ type : 'table' ,
56+ content : [
57+ {
58+ type : 'tableRow' ,
59+ content : [
60+ {
61+ type : 'tableHeader' ,
62+ attrs : { borders : cellBorders } ,
63+ content : [
64+ {
65+ type : 'paragraph' ,
66+ content : [ { type : 'run' , content : [ { type : 'text' , text : 'Column A' } ] } ] ,
67+ } ,
68+ ] ,
69+ } ,
70+ {
71+ type : 'tableHeader' ,
72+ attrs : { borders : cellBorders } ,
73+ content : [
74+ {
75+ type : 'paragraph' ,
76+ content : [ { type : 'run' , content : [ { type : 'text' , text : 'Column B' } ] } ] ,
77+ } ,
78+ ] ,
79+ } ,
80+ ] ,
81+ } ,
82+ {
83+ type : 'tableRow' ,
84+ content : [
85+ {
86+ type : 'tableCell' ,
87+ attrs : { borders : cellBorders } ,
88+ content : [ { type : 'paragraph' } ] ,
89+ } ,
90+ {
91+ type : 'tableCell' ,
92+ attrs : { borders : cellBorders } ,
93+ content : [ { type : 'paragraph' } ] ,
94+ } ,
95+ ] ,
96+ } ,
97+ ] ,
98+ } ,
99+ } ,
100+ } ,
23101] ;
24102
25103export function App ( ) {
0 commit comments