json-object-editor 0.10.633 → 0.10.638

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.
@@ -1,6 +1,59 @@
1
1
  var question ={
2
2
  title: 'Q | ${name}',
3
3
  info:"The question panel is where you can manage the questions used to build a form.",
4
+ // Curated summary for agents
5
+ summary:{
6
+ description:'Reusable question definition used to build forms with various input types.',
7
+ purpose:'Questions define form field types (text, select, boolean, etc.) and can be organized into forms. Questions can reference datasets for select/multiple types, can be marked as usable for visitor ID or submission date tracking, and are categorized with tags. Questions are used in the Questionnaire and Church apps.',
8
+ labelField:'name',
9
+ defaultSort:{ field:'joeUpdated', dir:'desc' },
10
+ searchableFields:['name','info','title','fieldname','_id'],
11
+ allowedSorts:['joeUpdated','created','name','question_type'],
12
+ relationships:{
13
+ outbound:[
14
+ { field:'tags', targetSchema:'tag', cardinality:'many' }
15
+ ],
16
+ inbound:{ graphRef:'server/relationships.graph.json' }
17
+ },
18
+ joeManagedFields:['created','joeUpdated'],
19
+ fields:[
20
+ { name:'_id', type:'string', required:true },
21
+ { name:'itemtype', type:'string', required:true, const:'question' },
22
+ { name:'name', type:'string', required:true },
23
+ { name:'info', type:'string' },
24
+ { name:'title', type:'string' },
25
+ { name:'fieldname', type:'string' },
26
+ { name:'question_type', type:'string', enumValues:['oneline','textarea','select','boolean','multiple','content','password','number'] },
27
+ { name:'question_dataset', type:'string' },
28
+ { name:'option_template', type:'string' },
29
+ { name:'value_template', type:'string' },
30
+ { name:'options', type:'objectList' },
31
+ { name:'content', type:'code' },
32
+ { name:'required', type:'boolean' },
33
+ { name:'canBeId', type:'boolean' },
34
+ { name:'canBeDate', type:'boolean' },
35
+ { name:'tags', type:'string', isArray:true, isReference:true, targetSchema:'tag' },
36
+ { name:'joeUpdated', type:'string', format:'date-time', required:true },
37
+ { name:'created', type:'string', format:'date-time', required:true }
38
+ ]
39
+ },
40
+ subsets:function(){
41
+ return [{name:'Required',filter:{required:true},stripeColor:'#ff9999'}
42
+
43
+ ].concat(_joe.Filter.Options.getDatasetPropertyValues(
44
+ 'question',
45
+ 'question_type',
46
+ { group: 'fieldtype', collapsed: false } // optional grouping
47
+ ));
48
+ },
49
+ stripeColor:function(item){
50
+ if(item.required){
51
+ return {
52
+ title:'Required',
53
+ color:'#ff9999'
54
+ };
55
+ }
56
+ },
4
57
  filters:function(item){
5
58
  return _joe.Filter.Options.tags({group:true,untagged:true,collapsed:true});
6
59
  },
@@ -20,12 +73,12 @@ var question ={
20
73
  return (['multiple','select'].indexOf(item.question_type) == -1);
21
74
  }
22
75
  },
23
- {name:'option_template',width:'33%',
76
+ {name:'option_template',width:'33%',display:'option template',comment:'template for each option, use ${property} to display the property value.',
24
77
  hidden:function(item){
25
78
  return (['multiple','select'].indexOf(item.question_type) == -1);
26
79
  }
27
80
  },
28
- {name:'value_template',width:'33%',
81
+ {name:'value_template',width:'33%',display:'value template',comment:'defaults to _id',
29
82
  hidden:function(item){
30
83
  return (['multiple','select'].indexOf(item.question_type) == -1);
31
84
  }
@@ -2,6 +2,36 @@ var schema ={
2
2
  title: 'Submission | ${form_name}',
3
3
  info:"A submission is a response to a form. ",
4
4
  menuicon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-19 -19 88 88" transform="rotate(-90)"><path d="M30 3A1 1 0 0 0 29.8 3L8 3 8 47 42 47 42 40.4 40 42 40 45 36.2 45 36 45.1 36 45 10 45 10 5 29 5 29 16 40 16 40 21 42 22.6 42 14.6 30.8 3.4A1 1 0 0 0 30.6 3.2L30.4 3 30.2 3A1 1 0 0 0 30 3zM31 6.4L38.6 14 31 14 31 6.4zM16 21L16 23 34 23 34 21 16 21zM38 22L38 28 31 28 31 35 38 35 38 41 50 31.5 38 22zM40 26.1L46.8 31.5 40 36.9 40 35 40 33 38 33 33 33 33 30 38 30 40 30 40 28 40 26.1zM16 27L16 29 29 29 29 27 16 27zM16 33L16 35 29 35 29 33 16 33z"/></svg>',
5
+ // Curated summary for agents
6
+ summary:{
7
+ description:'Form submission response containing visitor data and form answers.',
8
+ purpose:'Submissions store responses to forms. Each submission references a form and optionally a visitor (identified by form\'s visitor_id_field). Submission data contains the answers to form questions. Submissions are used in the Questionnaire and Church apps.',
9
+ labelField:'form_name',
10
+ defaultSort:{ field:'created', dir:'desc' },
11
+ searchableFields:['form_name','visitor','submission_date','_id'],
12
+ allowedSorts:['created','joeUpdated','submission_date','form_name'],
13
+ relationships:{
14
+ outbound:[
15
+ { field:'form', targetSchema:'form', cardinality:'one' },
16
+ { field:'visitor', targetSchema:'visitor', cardinality:'one' }
17
+ ],
18
+ inbound:{ graphRef:'server/relationships.graph.json' }
19
+ },
20
+ joeManagedFields:['created','joeUpdated'],
21
+ fields:[
22
+ { name:'_id', type:'string', required:true },
23
+ { name:'itemtype', type:'string', required:true, const:'submission' },
24
+ { name:'form_name', type:'string' },
25
+ { name:'form', type:'string', isReference:true, targetSchema:'form' },
26
+ { name:'visitor', type:'string', isReference:true, targetSchema:'visitor' },
27
+ { name:'submission_date', type:'string' },
28
+ { name:'data', type:'object' },
29
+ { name:'computed', type:'code' },
30
+ { name:'source', type:'string' },
31
+ { name:'joeUpdated', type:'string', format:'date-time', required:true },
32
+ { name:'created', type:'string', format:'date-time', required:true }
33
+ ]
34
+ },
5
35
  subsets:function(i){
6
36
  var subsets = [];
7
37
  return subsets;
@@ -0,0 +1,480 @@
1
+ joe-matrix {
2
+ display: block;
3
+ width: 100%;
4
+ height: 100%;
5
+ position: relative;
6
+ overflow: hidden;
7
+ background: #fafafa;
8
+ }
9
+
10
+ .matrix-controls {
11
+ position: absolute;
12
+ top: 10px;
13
+ left: 10px;
14
+ z-index: 1000;
15
+ background: rgba(255, 255, 255, 0.95);
16
+ padding: 15px;
17
+ border-radius: 8px;
18
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1)
19
+ }
20
+
21
+ .matrix-controls select,
22
+ .matrix-controls button {
23
+ margin: 5px;
24
+ padding: 8px 12px;
25
+ border: 1px solid #ddd;
26
+ border-radius: 4px;
27
+ background: white;
28
+ cursor: pointer;
29
+ font-size: 14px
30
+ }
31
+
32
+ .matrix-controls button:hover {
33
+ background: #f0f0f0
34
+ }
35
+
36
+ .matrix-controls label {
37
+ display: block;
38
+ margin-bottom: 4px;
39
+ font-size: 12px;
40
+ color: #666
41
+ }
42
+
43
+ joe-matrix .matrix-canvas {
44
+ width: 100%;
45
+ height: 100%;
46
+ cursor: grab;
47
+ }
48
+
49
+ joe-matrix .matrix-canvas:active {
50
+ cursor: grabbing;
51
+ }
52
+
53
+ joe-matrix .matrix-node {
54
+ cursor: pointer;
55
+ user-select: none;
56
+ }
57
+
58
+ joe-matrix .matrix-node circle {
59
+ fill: #4a90e2;
60
+ stroke: #2c5aa0;
61
+ stroke-width: 2px;
62
+ transition: all 0.2s ease;
63
+ }
64
+
65
+ joe-matrix .matrix-node-bg {
66
+ fill: #4a90e2;
67
+ stroke: #2c5aa0;
68
+ stroke-width: 2px;
69
+ transition: all 0.2s ease;
70
+ pointer-events: all;
71
+ cursor: pointer;
72
+ }
73
+
74
+ joe-matrix .matrix-node:hover .matrix-node-bg {
75
+ fill: #6ba3f0;
76
+ stroke-width: 3px;
77
+ }
78
+
79
+ joe-matrix .matrix-node:hover circle:not(.matrix-node-bg) {
80
+ fill: #6ba3f0;
81
+ stroke-width: 3px;
82
+ }
83
+
84
+ /* ============================================
85
+ SELECTED NODE STYLES
86
+ ============================================
87
+ These styles apply when a node has the "selected" class.
88
+ The selected class is added via JavaScript when a node is clicked.
89
+ ============================================ */
90
+
91
+ /* Background circle for selected nodes - orange color */
92
+ joe-matrix .matrix-node.selected .matrix-node-bg {
93
+ fill: #ff8804 !important;
94
+ stroke: #cc6d03 !important;
95
+ stroke-width: 3px !important;
96
+ }
97
+
98
+ /* Regular circles (non-background) for selected nodes - orange color */
99
+ joe-matrix .matrix-node.selected circle:not(.matrix-node-bg) {
100
+ fill: #ff8804 !important;
101
+ stroke: #cc6d03 !important;
102
+ stroke-width: 3px !important;
103
+ }
104
+
105
+ /* SVG icon container - pointer events disabled so clicks pass through */
106
+ joe-matrix .matrix-node-icon {
107
+ pointer-events: none;
108
+ }
109
+
110
+ joe-matrix .matrix-node-icon foreignObject {
111
+ overflow: visible;
112
+ }
113
+
114
+ /* SVG icon base styles */
115
+ joe-matrix .matrix-node-icon foreignObject svg {
116
+ width: 24px;
117
+ height: 24px;
118
+ display: block;
119
+ }
120
+
121
+ /* Make SVG icon white when node is selected */
122
+ joe-matrix .matrix-node.selected .matrix-node-icon foreignObject svg path {
123
+ fill: white;
124
+ stroke: white;
125
+ }
126
+
127
+ joe-matrix .matrix-node.selected .matrix-node-icon foreignObject svg circle {
128
+ fill: white;
129
+ stroke: white;
130
+ }
131
+
132
+ joe-matrix .matrix-node.selected .matrix-node-icon foreignObject svg rect {
133
+ fill: white;
134
+ stroke: white;
135
+ }
136
+
137
+ joe-matrix .matrix-node.selected .matrix-node-icon foreignObject svg polygon {
138
+ fill: white;
139
+ stroke: white;
140
+ }
141
+
142
+ joe-matrix .matrix-node.selected .matrix-node-icon foreignObject svg polyline {
143
+ stroke: white;
144
+ }
145
+
146
+ joe-matrix .matrix-node text {
147
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
148
+ font-size: 12px;
149
+ fill: #333;
150
+ pointer-events: none;
151
+ text-anchor: middle;
152
+ dominant-baseline: middle;
153
+ }
154
+
155
+ joe-matrix .matrix-link {
156
+ stroke: #999;
157
+ stroke-width: 1.5px;
158
+ stroke-opacity: 0.6;
159
+ fill: none;
160
+ pointer-events: none;
161
+ }
162
+
163
+ joe-matrix .matrix-link:hover {
164
+ stroke-opacity: 1;
165
+ stroke-width: 2px;
166
+ }
167
+
168
+ joe-matrix .matrix-link.many {
169
+ stroke-dasharray: 5, 5;
170
+ }
171
+
172
+ joe-matrix .matrix-link-label {
173
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
174
+ font-size: 10px;
175
+ fill: #666;
176
+ pointer-events: none;
177
+ text-anchor: middle;
178
+ background: rgba(255, 255, 255, 0.8);
179
+ padding: 2px 4px;
180
+ border-radius: 3px;
181
+ }
182
+
183
+ joe-matrix .matrix-link-label tspan {
184
+ fill: #333;
185
+ font-weight: 500;
186
+ }
187
+
188
+ joe-matrix .matrix-zoom-controls {
189
+ position: absolute;
190
+ top: 180px;
191
+ left: 10px;
192
+ z-index: 100;
193
+ background: rgba(255, 255, 255, 0.95);
194
+ padding: 10px;
195
+ border-radius: 8px;
196
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
197
+ display: flex;
198
+ flex-direction: column;
199
+ gap: 5px;
200
+ }
201
+
202
+ joe-matrix .matrix-zoom-controls button {
203
+ width: 40px;
204
+ height: 40px;
205
+ border: 1px solid #ddd;
206
+ border-radius: 4px;
207
+ background: white;
208
+ cursor: pointer;
209
+ font-size: 18px;
210
+ display: flex;
211
+ align-items: center;
212
+ justify-content: center;
213
+ }
214
+
215
+ joe-matrix .matrix-zoom-controls button:hover {
216
+ background: #f0f0f0;
217
+ }
218
+
219
+ joe-matrix .matrix-legend {
220
+ position: absolute;
221
+ top: 180px;
222
+ left: 80px;
223
+ z-index: 100;
224
+ background: rgba(255, 255, 255, 0.95);
225
+ padding: 15px;
226
+ border-radius: 8px;
227
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
228
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
229
+ font-size: 12px;
230
+ }
231
+
232
+ joe-matrix .matrix-legend h4 {
233
+ margin: 0 0 10px 0;
234
+ font-size: 14px;
235
+ font-weight: bold;
236
+ }
237
+
238
+ joe-matrix .matrix-legend-item {
239
+ display: flex;
240
+ align-items: center;
241
+ margin: 5px 0;
242
+ gap: 8px;
243
+ }
244
+
245
+ joe-matrix .matrix-legend-item .legend-color {
246
+ width: 20px;
247
+ height: 20px;
248
+ border-radius: 50%;
249
+ border: 2px solid;
250
+ }
251
+
252
+ joe-matrix .matrix-tooltip {
253
+ position: absolute;
254
+ background: rgba(0, 0, 0, 0.8);
255
+ color: white;
256
+ padding: 8px 12px;
257
+ border-radius: 4px;
258
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
259
+ font-size: 12px;
260
+ pointer-events: none;
261
+ z-index: 1000;
262
+ display: none;
263
+ }
264
+
265
+ joe-matrix .matrix-tooltip.visible {
266
+ display: block;
267
+ }
268
+
269
+ /* ============================================
270
+ MATRIX PROPERTIES PANEL
271
+ ============================================
272
+ Styles for the properties panel that appears when a node is clicked.
273
+ This panel displays schema information including relationships, fields, etc.
274
+ ============================================ */
275
+
276
+ /* Main properties panel container */
277
+ #matrix-properties-panel {
278
+ position: absolute;
279
+ top: 10px;
280
+ right: 10px;
281
+ width: 400px;
282
+ max-height: 80vh;
283
+ overflow-y: auto;
284
+ background: white;
285
+ border: 1px solid #ddd;
286
+ border-radius: 8px;
287
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
288
+ z-index: 1000;
289
+ padding: 20px;
290
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
291
+ font-size: 14px;
292
+ }
293
+
294
+ /* Panel header with title and close button */
295
+ #matrix-properties-panel .matrix-props-header {
296
+ display: flex;
297
+ justify-content: space-between;
298
+ align-items: center;
299
+ margin-bottom: 15px;
300
+ border-bottom: 2px solid #eee;
301
+ padding-bottom: 10px;
302
+ }
303
+
304
+ #matrix-properties-panel .matrix-props-title {
305
+ margin: 0;
306
+ font-size: 18px;
307
+ color: #333;
308
+ display: flex;
309
+ align-items: center;
310
+ gap: 8px;
311
+ }
312
+
313
+ #matrix-properties-panel .matrix-props-title-icon {
314
+ display: inline-flex;
315
+ align-items: center;
316
+ width: 24px;
317
+ height: 24px;
318
+ flex-shrink: 0;
319
+ }
320
+
321
+ #matrix-properties-panel .matrix-props-title-icon svg {
322
+ width: 24px;
323
+ height: 24px;
324
+ display: block;
325
+ }
326
+
327
+ #matrix-properties-panel .matrix-props-title-text {
328
+ flex: 1;
329
+ }
330
+
331
+ #matrix-properties-panel #close-properties {
332
+ background: none;
333
+ border: none;
334
+ font-size: 20px;
335
+ cursor: pointer;
336
+ color: #999;
337
+ padding: 0;
338
+ width: 24px;
339
+ height: 24px;
340
+ line-height: 1;
341
+ }
342
+
343
+ #matrix-properties-panel #close-properties:hover {
344
+ color: #666;
345
+ }
346
+
347
+ /* Section containers */
348
+ #matrix-properties-panel .matrix-props-section {
349
+ margin-bottom: 15px;
350
+ }
351
+
352
+ #matrix-properties-panel .matrix-props-text {
353
+ color: #666;
354
+ }
355
+
356
+ /* Code elements */
357
+ #matrix-properties-panel code {
358
+ background: #f5f5f5;
359
+ padding: 2px 6px;
360
+ border-radius: 3px;
361
+ font-weight: bold;
362
+ }
363
+
364
+ /* Relationships section */
365
+ #matrix-properties-panel .matrix-props-relationships {
366
+ margin-bottom: 20px;
367
+ padding: 12px;
368
+ background: #f0f7ff;
369
+ border-left: 4px solid #4a90e2;
370
+ border-radius: 4px;
371
+ }
372
+
373
+ #matrix-properties-panel .matrix-props-relationships-title {
374
+ display: block;
375
+ margin-bottom: 8px;
376
+ color: #2c5aa0;
377
+ }
378
+
379
+ #matrix-properties-panel .matrix-props-relationships-list {
380
+ display: flex;
381
+ flex-direction: column;
382
+ gap: 6px;
383
+ }
384
+
385
+ #matrix-properties-panel .matrix-props-relationship-item {
386
+ padding: 8px;
387
+ border: 1px solid #ddd;
388
+ border-radius: 4px;
389
+ }
390
+
391
+ #matrix-properties-panel .matrix-props-relationship-item.many {
392
+ background: #fff3cd;
393
+ border-color: #ffc107;
394
+ }
395
+
396
+ #matrix-properties-panel .matrix-props-relationship-item.one {
397
+ background: #d4edda;
398
+ border-color: #28a745;
399
+ }
400
+
401
+ #matrix-properties-panel .matrix-props-relationship-item.missing {
402
+ opacity: 0.5;
403
+ text-decoration: line-through;
404
+ }
405
+
406
+ #matrix-properties-panel .matrix-props-relationship-field {
407
+ background: rgba(255, 255, 255, 0.8);
408
+ padding: 2px 6px;
409
+ border-radius: 3px;
410
+ font-weight: bold;
411
+ margin-right: 6px;
412
+ }
413
+
414
+ #matrix-properties-panel .matrix-props-relationship-arrow {
415
+ margin: 0 4px;
416
+ }
417
+
418
+ #matrix-properties-panel .matrix-props-relationship-cardinality {
419
+ color: #666;
420
+ font-size: 11px;
421
+ }
422
+
423
+ #matrix-properties-panel .matrix-props-relationship-warning {
424
+ color: #d93025;
425
+ font-size: 11px;
426
+ }
427
+
428
+ /* No relationships message */
429
+ #matrix-properties-panel .matrix-props-no-relationships {
430
+ margin-bottom: 15px;
431
+ padding: 8px;
432
+ background: #fff3cd;
433
+ border-left: 4px solid #ffc107;
434
+ border-radius: 4px;
435
+ color: #856404;
436
+ }
437
+
438
+ #matrix-properties-panel .matrix-props-no-relationships-text {
439
+ font-size: 12px;
440
+ }
441
+
442
+ /* Fields section */
443
+ #matrix-properties-panel .matrix-props-fields-container {
444
+ /* max-height: 300px;
445
+ overflow-y: auto; */
446
+ margin-top: 8px;
447
+ border: 1px solid #eee;
448
+ border-radius: 4px;
449
+ padding: 8px;
450
+ }
451
+
452
+ #matrix-properties-panel .matrix-props-field-item {
453
+ padding: 6px;
454
+ border-bottom: 1px solid #f5f5f5;
455
+ }
456
+
457
+ #matrix-properties-panel .matrix-props-field-type {
458
+ color: #666;
459
+ font-size: 12px;
460
+ }
461
+
462
+ #matrix-properties-panel .matrix-props-field-comment {
463
+ color: #999;
464
+ font-size: 11px;
465
+ margin-left: 8px;
466
+ }
467
+
468
+ /* Searchable fields section */
469
+ #matrix-properties-panel .matrix-props-searchable-list {
470
+ margin-top: 4px;
471
+ }
472
+
473
+ #matrix-properties-panel .matrix-props-searchable-tag {
474
+ display: inline-block;
475
+ background: #e8f5e9;
476
+ padding: 2px 8px;
477
+ border-radius: 12px;
478
+ margin: 2px;
479
+ font-size: 12px;
480
+ }