pict-section-prompteditor 1.1.0 → 1.1.2

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 CHANGED
@@ -1,45 +1,45 @@
1
1
  {
2
- "name": "pict-section-prompteditor",
3
- "version": "1.1.0",
4
- "description": "Prompt crafting and management section for Pict: typed prompts with segments (context, request, success criteria), curated word list matrices with weights, a {~WordListEntry:Name~} template expression for weighted-random generation, batch generation with zip download, and a pluggable data provider that defaults to in-memory AppData.",
5
- "main": "source/Pict-Section-PromptEditor.js",
6
- "files": [
7
- "source"
8
- ],
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/fable-retold/pict-section-prompteditor.git"
12
- },
13
- "scripts": {
14
- "test": "npx mocha -u tdd -R spec --exit test/*_tests.js",
15
- "start": "node source/Pict-Section-PromptEditor.js",
16
- "build": "npx quack build",
17
- "build:codemirror": "node build/build-codemirror-bundle.js",
18
- "example": "npx quack examples",
19
- "docs": "npx quack prepare-docs ./docs"
20
- },
21
- "author": "steven velozo <steven@velozo.com>",
22
- "license": "MIT",
23
- "dependencies": {
24
- "jszip": "^3.10.1",
25
- "pict-section-content": "^1.0.15",
26
- "pict-section-markdowneditor": "^1.0.17",
27
- "pict-section-modal": "^1.1.4",
28
- "pict-section-picker": "^1.4.0",
29
- "pict-template": "^1.0.15",
30
- "pict-view": "^1.0.68"
31
- },
32
- "devDependencies": {
33
- "@codemirror/lang-markdown": "^6.5.0",
34
- "@codemirror/state": "^6.6.0",
35
- "@codemirror/view": "^6.43.0",
36
- "chai": "^4.5.0",
37
- "codemirror": "^6.0.2",
38
- "esbuild": "^0.28.0",
39
- "jsdom": "^25.0.1",
40
- "mocha": "^11.0.1",
41
- "pict": "^1.0.381",
42
- "pict-docuserve": "^1.4.19",
43
- "quackage": "^1.3.0"
44
- }
2
+ "name": "pict-section-prompteditor",
3
+ "version": "1.1.2",
4
+ "description": "Prompt crafting and management section for Pict: typed prompts with segments (context, request, success criteria), curated word list matrices with weights, a {~WordListEntry:Name~} template expression for weighted-random generation, batch generation with zip download, and a pluggable data provider that defaults to in-memory AppData.",
5
+ "main": "source/Pict-Section-PromptEditor.js",
6
+ "files": [
7
+ "source"
8
+ ],
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/fable-retold/pict-section-prompteditor.git"
12
+ },
13
+ "scripts": {
14
+ "test": "npx mocha -u tdd -R spec --exit test/*_tests.js",
15
+ "start": "node source/Pict-Section-PromptEditor.js",
16
+ "build": "npx quack build",
17
+ "build:codemirror": "node build/build-codemirror-bundle.js",
18
+ "example": "npx quack examples",
19
+ "docs": "npx quack prepare-docs ./docs"
20
+ },
21
+ "author": "steven velozo <steven@velozo.com>",
22
+ "license": "MIT",
23
+ "dependencies": {
24
+ "jszip": "^3.10.1",
25
+ "pict-section-content": "^1.0.15",
26
+ "pict-section-markdowneditor": "^1.0.17",
27
+ "pict-section-modal": "^1.1.4",
28
+ "pict-section-picker": "^1.4.0",
29
+ "pict-template": "^1.0.15",
30
+ "pict-view": "^1.0.68"
31
+ },
32
+ "devDependencies": {
33
+ "@codemirror/lang-markdown": "^6.5.0",
34
+ "@codemirror/state": "^6.6.0",
35
+ "@codemirror/view": "^6.43.0",
36
+ "chai": "^4.5.0",
37
+ "codemirror": "^6.0.2",
38
+ "esbuild": "^0.28.0",
39
+ "jsdom": "^25.0.1",
40
+ "mocha": "^11.0.1",
41
+ "pict": "^1.0.381",
42
+ "pict-docuserve": "^1.4.19",
43
+ "quackage": "^1.3.0"
44
+ }
45
45
  }
@@ -83,13 +83,25 @@ const _DefaultConfiguration =
83
83
  CSS: /*css*/`
84
84
  .pspe { font-size: 14px; color: var(--theme-color-text-primary, #1f2430); }
85
85
  .pspe-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
86
- .pspe-title { font-size: 16px; font-weight: 650; margin-right: auto; }
86
+ /* Structural titles take the theme's optional display face + treatment.
87
+ The fallbacks (inherit / none / normal / 650) keep the look unchanged
88
+ for hosts whose theme does not define a display family. A host whose
89
+ brand carries one (e.g. a drafting/engraving face) gets it here with
90
+ no app-side override. */
91
+ .pspe-title { font-size: 16px; margin-right: auto;
92
+ font-family: var(--theme-typography-family-display, inherit);
93
+ text-transform: var(--theme-typography-display-transform, none);
94
+ letter-spacing: var(--theme-typography-display-tracking, normal);
95
+ font-weight: var(--theme-typography-display-weight, 650); }
87
96
  .pspe-tabs { display: flex; gap: 4px; }
88
97
  .pspe-tab {
89
98
  font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer;
90
99
  border: 1px solid var(--theme-color-border-default, #d6dde3);
91
100
  background: var(--theme-color-background-panel, #fff);
92
101
  color: var(--theme-color-text-secondary, #5b6470); border-radius: 8px;
102
+ font-family: var(--theme-typography-family-display, inherit);
103
+ text-transform: var(--theme-typography-display-transform, none);
104
+ letter-spacing: var(--theme-typography-display-tracking, normal);
93
105
  }
94
106
  .pspe-tab-on { background: var(--theme-color-brand-primary, #2880a6); border-color: var(--theme-color-brand-primary, #2880a6); color: var(--theme-color-text-on-brand, #fff); }
95
107
  .pspe-tab-count { opacity: 0.75; font-size: 11px; margin-left: 4px; }
@@ -144,7 +156,11 @@ const _DefaultConfiguration =
144
156
  background: var(--theme-color-background-panel, #fff); padding: 12px 14px; margin-bottom: 10px;
145
157
  }
146
158
  .pspe-segment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
147
- .pspe-segment-name { font-weight: 650; font-size: 13.5px; }
159
+ .pspe-segment-name { font-size: 13.5px;
160
+ font-family: var(--theme-typography-family-display, inherit);
161
+ text-transform: var(--theme-typography-display-transform, none);
162
+ letter-spacing: var(--theme-typography-display-tracking, normal);
163
+ font-weight: var(--theme-typography-display-weight, 650); }
148
164
  .pspe-segment-guidance { font-size: 12px; color: var(--theme-color-text-muted, #97a1ab); margin-right: auto; }
149
165
  .pspe-pill {
150
166
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 8px; border-radius: 999px;
@@ -172,7 +188,11 @@ const _DefaultConfiguration =
172
188
  .pspe-generate-note { font-size: 12px; color: var(--theme-color-text-muted, #97a1ab); margin-left: auto; }
173
189
  .pspe-preview-panel { margin-top: 12px; }
174
190
  .pspe-preview-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
175
- .pspe-preview-title { font-weight: 650; font-size: 13.5px; }
191
+ .pspe-preview-title { font-size: 13.5px;
192
+ font-family: var(--theme-typography-family-display, inherit);
193
+ text-transform: var(--theme-typography-display-transform, none);
194
+ letter-spacing: var(--theme-typography-display-tracking, normal);
195
+ font-weight: var(--theme-typography-display-weight, 650); }
176
196
  .pspe-preview-note { font-size: 12px; color: var(--theme-color-text-muted, #97a1ab); margin-right: auto; }
177
197
  .pspe-btn-on, .pspe-btn-on:hover { background: var(--theme-color-brand-primary, #2880a6); border-color: var(--theme-color-brand-primary, #2880a6); color: var(--theme-color-text-on-brand, #fff); }
178
198
  .pspe-preview-raw {
@@ -712,6 +732,17 @@ class PictViewPromptEditor extends libPictView
712
732
  this.render();
713
733
  }
714
734
 
735
+ /* Replace the selectable prompt-type set (the cascade behind the type dropdown) and repaint. The
736
+ type list is cached as this._types at construction; a host that updates its shape library
737
+ mid-session calls this so the dropdown reflects the new set without a full page reload. */
738
+ setPromptTypes(pTypes)
739
+ {
740
+ this.options.PromptTypes = pTypes || null;
741
+ this._types = libTypes.resolvePromptTypes(this.options.PromptTypes);
742
+ this._shape();
743
+ this.render();
744
+ }
745
+
715
746
  setDataProvider(pProvider)
716
747
  {
717
748
  this._provider = pProvider || null;