@_neronotte/theme-studio 0.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/README.md ADDED
@@ -0,0 +1,146 @@
1
+ # Theme Studio (by \_neronotte)
2
+
3
+ A **Power Platform Toolbox tool** that lets makers customize Model-Driven App
4
+ [modern themes](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/modern-theme-overrides)
5
+ with a WYSIWYG editor: a live preview of the app shell (grid and form views)
6
+ next to a panel for editing the theme XML (palette, typography, logo, app
7
+ header colors).
8
+
9
+ See [`docs/REQUIREMENTS.md`](./docs/REQUIREMENTS.md) and
10
+ [`docs/IMPLEMENTATION_PLAN.md`](./docs/IMPLEMENTATION_PLAN.md) for the full
11
+ requirements, design decisions and phased delivery plan. This tool is under
12
+ active development; see the plan for current status.
13
+
14
+ ## Structure
15
+
16
+ ```
17
+ greg-pptb-themestudio/
18
+ ├── docs/ # requirements, implementation plan, theme XML reference, samples
19
+ ├── src/
20
+ │ ├── App.tsx # shell layout: config bar / preview / theme panel
21
+ │ ├── main.tsx # entry point
22
+ │ ├── index.css # global styling
23
+ │ ├── components/
24
+ │ │ ├── ErrorBoundary.tsx # top-level error boundary
25
+ │ │ ├── config/ # ConfigPanel: solution, theme file, logo, scope
26
+ │ │ ├── theme/ # ThemePanel: palette/typography/logo/header editors
27
+ │ │ └── preview/ # PreviewFrame: app shell replica, view/form preview tabs
28
+ │ │ └── shell/ # header, navigation and command bar shared by both tabs
29
+ │ ├── model/ # ThemeModel, XML parse/serialize, brand ramp, contrast, XML diff,
30
+ │ │ # colour extraction (quantiser) and role mapping
31
+ │ ├── services/
32
+ │ │ ├── themeFile.ts # theme XML import/export via the PPTB filesystem API
33
+ │ │ ├── webResources.ts # web resource list/read/create/update/publish + solution association
34
+ │ │ ├── solutions.ts # solution picker source (unmanaged, visible solutions)
35
+ │ │ ├── themeScope.ts # environment/app scope assignment + maker-portal fallback
36
+ │ │ ├── logo.ts # logo image pick/upload, size validation, data URI
37
+ │ │ ├── imageImport.ts # screenshot import: file / clipboard / drag & drop → pixels
38
+ │ │ └── siteCapture.ts # website URL validation + assisted screenshot capture
39
+ │ ├── state/
40
+ │ │ ├── ThemeContext.tsx # theme state provider + derived palette/preview theme
41
+ │ │ ├── ConfigContext.tsx # connection, solution, theme web resource, logo
42
+ │ │ └── themeReducer.ts # pure reducer: edits, undo/redo, dirty tracking
43
+ │ └── hooks/
44
+ │ └── useToolboxAPI.ts # connection, host-theme and event helpers
45
+ ├── dist/ # build output
46
+ ├── index.html
47
+ ├── package.json
48
+ ├── tsconfig.json
49
+ └── vite.config.ts
50
+ ```
51
+
52
+ ## Using the tool
53
+
54
+ The tool requires an active Dataverse connection in Power Platform ToolBox.
55
+
56
+ 1. **Pick a solution** in the config bar. This is mandatory: the theme web resource (and any logo
57
+ uploaded with it) is always added to the solution you choose — there is no default-solution
58
+ fallback.
59
+ 2. **Open** an existing theme XML web resource, or start a **New** one. Managed web resources can
60
+ be inspected but not overwritten.
61
+ 3. Edit the theme in the right-hand panel — palette, typography, logo and app header colours — and
62
+ watch the preview repaint live. Themes can also be imported from / exported to a local file.
63
+ 4. **Save to Dataverse**: the pre-save dialog shows an old-vs-new XML diff, lets you name a new web
64
+ resource, and optionally publishes it (publishing is required for updates to take effect and
65
+ affects the whole environment).
66
+ 5. **Get colors from a website** (Palette section): derive the theme from an existing site instead
67
+ of picking every colour by hand — see below.
68
+ 6. **Apply theme**: assign the saved web resource to the whole environment or to a single app. Where
69
+ the setting can't be written through the API, the dialog shows the unique name to paste and deep
70
+ links into the solution in the maker portal.
71
+
72
+ ### Getting the colors from a website
73
+
74
+ The **Get colors from a website** button in the Palette section opens a three-step wizard:
75
+
76
+ 1. **Source** — type a site address and press _Open the site_, or browse for / paste (Ctrl+V) /
77
+ drag & drop a screenshot. Power Platform ToolBox exposes no screenshot API, so a URL is
78
+ resolved by _assisted capture_: the site opens in your browser, you take the screenshot and
79
+ paste it back into the wizard. Nothing is uploaded and no third-party service is called.
80
+ 2. **Image** — drag on the screenshot to analyse only a region (or use _Header only_), or click a
81
+ single pixel to use its exact colour. Near-white, near-black and — unless you turn _Ignore
82
+ greys_ off — near-grey pixels are treated as noise.
83
+ 3. **Colors & roles** — the ranked colours are shown with their coverage and mapped onto the base
84
+ palette colour and the app header background/foreground, with the live WCAG contrast readout.
85
+ Everything is editable, and _Apply_ is a single undoable step. Palette slot overrides are only
86
+ filled in when you explicitly ask for them.
87
+
88
+ The screenshot is working data only: it is never saved to Dataverse and never stored in the
89
+ ToolBox settings — only the extraction options (ignore greys, colour count, slot overrides) are
90
+ remembered.
91
+
92
+ ## Installation
93
+
94
+ **Build the tool:**
95
+
96
+ ```bash
97
+ npm run build
98
+ ```
99
+
100
+ **Dev build with sourcemaps (watch mode):**
101
+
102
+ ```bash
103
+ npm run dev-watch
104
+ ```
105
+
106
+ **Run the unit tests:**
107
+
108
+ ```bash
109
+ npm test
110
+ ```
111
+
112
+ **Validate tool package:**
113
+
114
+ ```bash
115
+ npm run validate
116
+ ```
117
+
118
+ **Shrinkwrap package:**
119
+
120
+ ```bash
121
+ npm run finalize-package
122
+ ```
123
+
124
+ or;
125
+
126
+ ```bash
127
+ npm shrinkwrap
128
+ ```
129
+
130
+ **Publish new version:**
131
+
132
+ ```bash
133
+ npm run publish-package
134
+ ```
135
+
136
+ _Further tool development documentation is available @ https://docs.powerplatformtoolbox.com/tool-development_
137
+
138
+ ## Usage in ToolBox
139
+
140
+ 1. Build the tool using `npm run build`
141
+ 2. Install the tool in ToolBox
142
+ 3. Load and use the tool from the ToolBox interface
143
+
144
+ ## License
145
+
146
+ MIT