pict-section-inlinedocumentation 0.0.1 → 0.0.4
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/package.json +6 -6
- package/source/providers/Pict-Provider-InlineDocumentation.js +2 -2
- package/source/views/Pict-View-InlineDocumentation-Content.js +5 -5
- package/source/views/Pict-View-InlineDocumentation-Layout.js +2 -2
- package/source/views/Pict-View-InlineDocumentation-Nav.js +6 -6
- package/source/views/Pict-View-InlineDocumentation-TopicManager.js +2 -2
- package/test/Browser_Integration_tests.js +34 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pict-section-inlinedocumentation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Pict embeddable inline documentation browser with topic support",
|
|
5
5
|
"main": "source/Pict-Section-InlineDocumentation.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"homepage": "https://github.com/stevenvelozo/pict-section-inlinedocumentation#readme",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"pict-provider": "^1.0.12",
|
|
26
|
-
"pict-section-content": "^0.
|
|
27
|
-
"pict-section-markdowneditor": "
|
|
28
|
-
"pict-section-modal": "
|
|
29
|
-
"pict-view": "^1.0.
|
|
26
|
+
"pict-section-content": "^0.1.5",
|
|
27
|
+
"pict-section-markdowneditor": "^1.0.9",
|
|
28
|
+
"pict-section-modal": "^0.0.4",
|
|
29
|
+
"pict-view": "^1.0.68"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"pict": "^1.0.
|
|
32
|
+
"pict": "^1.0.363",
|
|
33
33
|
"pict-docuserve": "^0.1.5",
|
|
34
34
|
"puppeteer": "^24.40.0",
|
|
35
35
|
"quackage": "^1.1.0"
|
|
@@ -55,7 +55,7 @@ class InlineDocumentationProvider extends libPictProvider
|
|
|
55
55
|
{
|
|
56
56
|
RenderableHash: 'MarkdownEditor-Wrap',
|
|
57
57
|
TemplateHash: 'MarkdownEditor-Container',
|
|
58
|
-
|
|
58
|
+
ContentDestinationAddress: '#InlineDoc-Editor-Container'
|
|
59
59
|
}
|
|
60
60
|
];
|
|
61
61
|
this.pict.addViewSingleton('InlineDoc-MarkdownEditor', tmpEditorConfig, libPictSectionMarkdownEditor);
|
|
@@ -137,7 +137,7 @@ class InlineDocumentationProvider extends libPictProvider
|
|
|
137
137
|
{
|
|
138
138
|
for (let i = 0; i < tmpLayoutView.options.Renderables.length; i++)
|
|
139
139
|
{
|
|
140
|
-
tmpLayoutView.options.Renderables[i].
|
|
140
|
+
tmpLayoutView.options.Renderables[i].ContentDestinationAddress = tmpOptions.ContainerAddress;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -5,7 +5,7 @@ const _ViewConfiguration =
|
|
|
5
5
|
ViewIdentifier: "InlineDoc-Content",
|
|
6
6
|
|
|
7
7
|
DefaultRenderable: "InlineDoc-Content-Display",
|
|
8
|
-
|
|
8
|
+
DefaultContentDestinationAddress: "#InlineDoc-Content-Container",
|
|
9
9
|
|
|
10
10
|
AutoRender: false,
|
|
11
11
|
|
|
@@ -286,9 +286,9 @@ const _ViewConfiguration =
|
|
|
286
286
|
Template: /*html*/`
|
|
287
287
|
<div class="pict-inline-doc-edit-toolbar" id="InlineDoc-Edit-Toolbar">
|
|
288
288
|
<span class="edit-label" id="InlineDoc-Edit-Label">View mode</span>
|
|
289
|
-
<button class="pict-inline-doc-edit-btn" id="InlineDoc-Edit-Toggle" title="Edit this document"><span class="btn-icon"
|
|
290
|
-
<button class="pict-inline-doc-edit-btn primary" id="InlineDoc-Edit-Save" style="display:none"><span class="btn-icon"
|
|
291
|
-
<button class="pict-inline-doc-edit-btn" id="InlineDoc-Edit-Cancel" style="display:none"><span class="btn-icon"
|
|
289
|
+
<button class="pict-inline-doc-edit-btn" id="InlineDoc-Edit-Toggle" title="Edit this document"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3z"/><line x1="9" y1="4" x2="12" y2="7"/></svg></span> Edit</button>
|
|
290
|
+
<button class="pict-inline-doc-edit-btn primary" id="InlineDoc-Edit-Save" style="display:none"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,8 6.5,11.5 13,4.5"/></svg></span> Save</button>
|
|
291
|
+
<button class="pict-inline-doc-edit-btn" id="InlineDoc-Edit-Cancel" style="display:none"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span> Cancel</button>
|
|
292
292
|
</div>
|
|
293
293
|
<div class="pict-inline-doc-content pict-content" id="InlineDoc-Content-Body">
|
|
294
294
|
<div class="pict-inline-doc-content-loading">Loading...</div>
|
|
@@ -302,7 +302,7 @@ const _ViewConfiguration =
|
|
|
302
302
|
{
|
|
303
303
|
RenderableHash: "InlineDoc-Content-Display",
|
|
304
304
|
TemplateHash: "InlineDoc-Content-Template",
|
|
305
|
-
|
|
305
|
+
ContentDestinationAddress: "#InlineDoc-Content-Container",
|
|
306
306
|
RenderMethod: "replace"
|
|
307
307
|
}
|
|
308
308
|
]
|
|
@@ -5,7 +5,7 @@ const _ViewConfiguration =
|
|
|
5
5
|
ViewIdentifier: "InlineDoc-Layout",
|
|
6
6
|
|
|
7
7
|
DefaultRenderable: "InlineDoc-Layout-Container",
|
|
8
|
-
|
|
8
|
+
DefaultContentDestinationAddress: "#InlineDoc-Container",
|
|
9
9
|
|
|
10
10
|
AutoRender: false,
|
|
11
11
|
|
|
@@ -122,7 +122,7 @@ const _ViewConfiguration =
|
|
|
122
122
|
{
|
|
123
123
|
RenderableHash: "InlineDoc-Layout-Container",
|
|
124
124
|
TemplateHash: "InlineDoc-Layout-Template",
|
|
125
|
-
|
|
125
|
+
ContentDestinationAddress: "#InlineDoc-Container",
|
|
126
126
|
RenderMethod: "replace"
|
|
127
127
|
}
|
|
128
128
|
]
|
|
@@ -5,7 +5,7 @@ const _ViewConfiguration =
|
|
|
5
5
|
ViewIdentifier: "InlineDoc-Nav",
|
|
6
6
|
|
|
7
7
|
DefaultRenderable: "InlineDoc-Nav-Display",
|
|
8
|
-
|
|
8
|
+
DefaultContentDestinationAddress: "#InlineDoc-Nav-Container",
|
|
9
9
|
|
|
10
10
|
AutoRender: false,
|
|
11
11
|
|
|
@@ -189,7 +189,7 @@ const _ViewConfiguration =
|
|
|
189
189
|
{
|
|
190
190
|
RenderableHash: "InlineDoc-Nav-Display",
|
|
191
191
|
TemplateHash: "InlineDoc-Nav-Template",
|
|
192
|
-
|
|
192
|
+
ContentDestinationAddress: "#InlineDoc-Nav-Container",
|
|
193
193
|
RenderMethod: "replace"
|
|
194
194
|
}
|
|
195
195
|
]
|
|
@@ -265,7 +265,7 @@ class InlineDocumentationNavView extends libPictView
|
|
|
265
265
|
|
|
266
266
|
tmpHTML += '<div class="pict-inline-doc-nav-topic-badge">'
|
|
267
267
|
+ this._escapeHTML(tmpTopicName)
|
|
268
|
-
+ '<span class="pict-inline-doc-nav-topic-clear" id="InlineDoc-Nav-ClearTopic"
|
|
268
|
+
+ '<span class="pict-inline-doc-nav-topic-clear" id="InlineDoc-Nav-ClearTopic"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span>'
|
|
269
269
|
+ '</div>';
|
|
270
270
|
}
|
|
271
271
|
|
|
@@ -273,13 +273,13 @@ class InlineDocumentationNavView extends libPictView
|
|
|
273
273
|
if (tmpState.TopicManagerEnabled)
|
|
274
274
|
{
|
|
275
275
|
tmpHTML += '<div class="pict-inline-doc-nav-toolbar">';
|
|
276
|
-
tmpHTML += '<button class="pict-inline-doc-nav-toolbar-btn" id="InlineDoc-Nav-ManageTopics" title="Manage Topics"
|
|
276
|
+
tmpHTML += '<button class="pict-inline-doc-nav-toolbar-btn" id="InlineDoc-Nav-ManageTopics" title="Manage Topics"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="2.5"/><path d="M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.41 1.41M11.54 11.54l1.41 1.41M3.05 12.95l1.41-1.41M11.54 4.46l1.41-1.41"/></svg></button>';
|
|
277
277
|
if (tmpState.CurrentRoute)
|
|
278
278
|
{
|
|
279
|
-
tmpHTML += '<button class="pict-inline-doc-nav-toolbar-btn accent" id="InlineDoc-Nav-BindTopic" title="Bind topic to current route"
|
|
279
|
+
tmpHTML += '<button class="pict-inline-doc-nav-toolbar-btn accent" id="InlineDoc-Nav-BindTopic" title="Bind topic to current route"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 9.5a3.5 3.5 0 005 0l2-2a3.5 3.5 0 00-5-5l-1 1"/><path d="M9.5 6.5a3.5 3.5 0 00-5 0l-2 2a3.5 3.5 0 005 5l1-1"/></svg></button>';
|
|
280
280
|
}
|
|
281
281
|
let tmpTooltipEditActive = tmpState.TooltipEditMode ? ' active' : '';
|
|
282
|
-
tmpHTML += '<button class="pict-inline-doc-nav-toolbar-btn' + tmpTooltipEditActive + '" id="InlineDoc-Nav-TooltipEditMode" title="Toggle tooltip edit mode"
|
|
282
|
+
tmpHTML += '<button class="pict-inline-doc-nav-toolbar-btn' + tmpTooltipEditActive + '" id="InlineDoc-Nav-TooltipEditMode" title="Toggle tooltip edit mode"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 10a1.5 1.5 0 01-1.5 1.5H4l-3 3V3A1.5 1.5 0 012.5 1.5h10A1.5 1.5 0 0114 3z"/></svg></button>';
|
|
283
283
|
tmpHTML += '<span class="pict-inline-doc-nav-toolbar-spacer"></span>';
|
|
284
284
|
tmpHTML += '</div>';
|
|
285
285
|
}
|
|
@@ -493,8 +493,8 @@ class InlineDocumentationTopicManagerView extends libPictView
|
|
|
493
493
|
tmpHTML += '</div>';
|
|
494
494
|
tmpHTML += '</div>';
|
|
495
495
|
tmpHTML += '<div class="pict-inline-doc-tm-topic-actions">';
|
|
496
|
-
tmpHTML += '<button class="pict-inline-doc-tm-action-btn" data-action="edit" data-topic-code="' + this._escapeHTML(tmpTopic.TopicCode) + '" title="Edit"
|
|
497
|
-
tmpHTML += '<button class="pict-inline-doc-tm-action-btn danger" data-action="delete" data-topic-code="' + this._escapeHTML(tmpTopic.TopicCode) + '" title="Delete"
|
|
496
|
+
tmpHTML += '<button class="pict-inline-doc-tm-action-btn" data-action="edit" data-topic-code="' + this._escapeHTML(tmpTopic.TopicCode) + '" title="Edit"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3z"/><line x1="9" y1="4" x2="12" y2="7"/></svg></button>';
|
|
497
|
+
tmpHTML += '<button class="pict-inline-doc-tm-action-btn danger" data-action="delete" data-topic-code="' + this._escapeHTML(tmpTopic.TopicCode) + '" title="Delete"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></button>';
|
|
498
498
|
tmpHTML += '</div>';
|
|
499
499
|
tmpHTML += '</div>';
|
|
500
500
|
}
|
|
@@ -284,28 +284,19 @@ suite
|
|
|
284
284
|
(
|
|
285
285
|
function(fDone)
|
|
286
286
|
{
|
|
287
|
+
this.timeout(120000);
|
|
288
|
+
|
|
287
289
|
_RunStartTime = new Date().toISOString();
|
|
288
290
|
|
|
289
291
|
// Ensure artifacts dir
|
|
290
292
|
ensureArtifactsDir();
|
|
291
293
|
|
|
292
|
-
|
|
293
|
-
if (!libFS.existsSync(libPath.join(_BookshopDistDir, 'index.html')))
|
|
294
|
-
{
|
|
295
|
-
return fDone(new Error(
|
|
296
|
-
'Bookshop dist/index.html not found. Run "cd example_applications/bookshop && npx quack build && npx quack copy" first.'
|
|
297
|
-
));
|
|
298
|
-
}
|
|
294
|
+
let tmpBookshopDir = libPath.join(_PackageRoot, 'example_applications', 'bookshop');
|
|
299
295
|
|
|
300
|
-
|
|
296
|
+
let tmpStartServer = () =>
|
|
301
297
|
{
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
));
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// Start the test server
|
|
308
|
-
startTestServer(
|
|
298
|
+
// Start the test server
|
|
299
|
+
startTestServer(
|
|
309
300
|
function(pError, pServer, pPort)
|
|
310
301
|
{
|
|
311
302
|
if (pError)
|
|
@@ -377,6 +368,34 @@ suite
|
|
|
377
368
|
return fDone(pError);
|
|
378
369
|
});
|
|
379
370
|
});
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
// Auto-build the bookshop example if dist/ is missing
|
|
374
|
+
let tmpNeedsBuild = !libFS.existsSync(libPath.join(_BookshopDistDir, 'index.html'))
|
|
375
|
+
|| !libFS.existsSync(libPath.join(_BookshopDistDir, 'bookshop_example.js'));
|
|
376
|
+
|
|
377
|
+
if (tmpNeedsBuild)
|
|
378
|
+
{
|
|
379
|
+
console.log(' Bookshop dist/ not found — building automatically...');
|
|
380
|
+
|
|
381
|
+
let tmpExec = require('child_process').exec;
|
|
382
|
+
let tmpInstallAndBuild = 'cd ' + tmpBookshopDir + ' && npm install --silent && npm run build';
|
|
383
|
+
|
|
384
|
+
tmpExec(tmpInstallAndBuild, { timeout: 90000 },
|
|
385
|
+
function(pError, pStdout, pStderr)
|
|
386
|
+
{
|
|
387
|
+
if (pError)
|
|
388
|
+
{
|
|
389
|
+
return fDone(new Error('Auto-build of bookshop failed: ' + (pStderr || pError.message)));
|
|
390
|
+
}
|
|
391
|
+
console.log(' Bookshop built successfully.');
|
|
392
|
+
tmpStartServer();
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
else
|
|
396
|
+
{
|
|
397
|
+
tmpStartServer();
|
|
398
|
+
}
|
|
380
399
|
}
|
|
381
400
|
);
|
|
382
401
|
|