proposal-studio 0.1.2 → 0.2.1
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 +125 -11
- package/dist/editor-document.html +15 -15
- package/dist/proposal-studio.cjs +15 -15
- package/dist/proposal-studio.esm.js +15 -15
- package/dist/proposal-studio.global.js +15 -15
- package/dist/proposal-studio.global.min.js +15 -15
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -19,9 +19,8 @@ This is the **complete editor UI** — top toolbar, left component palette
|
|
|
19
19
|
(Templates / History), the canvas, and the right Properties / Data Binding /
|
|
20
20
|
Style panels — bundled into one self-contained document. The whole thing runs
|
|
21
21
|
inside an isolated, same-origin `iframe`, so its internal Angular runtime /
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
editors** on one page.
|
|
22
|
+
globals **never collide** with your host app (which can be a different Angular
|
|
23
|
+
version, React, Vue, …), and you can mount **multiple editors** on one page.
|
|
25
24
|
|
|
26
25
|
> **Sizing:** the editor is a full app with its own internal scrolling, so give
|
|
27
26
|
> it a height — e.g. `<proposal-studio style="height:90vh">`. It defaults to
|
|
@@ -33,6 +32,18 @@ editors** on one page.
|
|
|
33
32
|
|
|
34
33
|
---
|
|
35
34
|
|
|
35
|
+
## Live Demo
|
|
36
|
+
|
|
37
|
+
**Try it instantly — no install, no sign-up:**
|
|
38
|
+
|
|
39
|
+
👉 **[proposal-studio live demo](https://proposal-builder-mani.vercel.app/)**
|
|
40
|
+
|
|
41
|
+
The demo runs the full editor in the browser. You can drag blocks, edit rich text,
|
|
42
|
+
resize images, draw shapes, use zoom shortcuts, and measure distances between
|
|
43
|
+
elements — everything described below works live.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
36
47
|
## Install
|
|
37
48
|
|
|
38
49
|
```bash
|
|
@@ -45,10 +56,6 @@ Or use it straight from a CDN, no build step:
|
|
|
45
56
|
<script src="https://unpkg.com/proposal-studio"></script>
|
|
46
57
|
```
|
|
47
58
|
|
|
48
|
-
> **Internet note:** rich-text editing loads Froala + Font Awesome + jQuery from
|
|
49
|
-
> a CDN at runtime. The editor needs network access on first paint. Froala is a
|
|
50
|
-
> commercial product — see [Licensing](#licensing).
|
|
51
|
-
|
|
52
59
|
---
|
|
53
60
|
|
|
54
61
|
## Quick start (plain HTML)
|
|
@@ -129,6 +136,110 @@ framework.
|
|
|
129
136
|
|
|
130
137
|
---
|
|
131
138
|
|
|
139
|
+
## Features
|
|
140
|
+
|
|
141
|
+
### Custom Rich Text Editor (no licence required)
|
|
142
|
+
|
|
143
|
+
The editor ships a **built-in, dependency-free rich-text engine** (`CustomRichEditor`)
|
|
144
|
+
that replaces the commercial Froala editor. No CDN calls, no third-party licence.
|
|
145
|
+
The engine is controlled by a single flag in `canvas-config.js`:
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
// canvas-config.js
|
|
149
|
+
editor: {
|
|
150
|
+
useFroala: false, // default — uses the built-in CustomRichEditor
|
|
151
|
+
// useFroala: true // opt back in to Froala (requires a Froala licence)
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**`useFroala: false` (default)** — fully self-contained:
|
|
156
|
+
- Bold · italic · underline · strikethrough · subscript · superscript
|
|
157
|
+
- Heading styles (H1–H6, applied inline so only the selected run is styled)
|
|
158
|
+
- Font family · font size · line height · letter spacing
|
|
159
|
+
- Text case (UPPER / Capitalize / lower / as-typed)
|
|
160
|
+
- Text colour · highlight colour
|
|
161
|
+
- Align left / center / right / justify
|
|
162
|
+
- Ordered / unordered lists · outdent / indent
|
|
163
|
+
- Insert / edit / remove links
|
|
164
|
+
- Clear formatting · undo / redo
|
|
165
|
+
- Toolbar placement: **inline** (floats above the active block) or **docked**
|
|
166
|
+
(sticky strip pinned to the top of the canvas — toggled from Page Settings)
|
|
167
|
+
|
|
168
|
+
**`useFroala: true`** — reverts to the legacy Froala engine (commercial licence
|
|
169
|
+
required; jQuery + Font Awesome loaded from CDN).
|
|
170
|
+
|
|
171
|
+
### Figma-style Distance Measurement
|
|
172
|
+
|
|
173
|
+
Hold **Ctrl** (or **⌘** on Mac) while hovering another free-positioned block to
|
|
174
|
+
see the pixel gap between the two elements — exactly like Figma's measure mode:
|
|
175
|
+
|
|
176
|
+
- Selected block gets a solid reference outline
|
|
177
|
+
- Hovered block gets a dashed marching-ants outline
|
|
178
|
+
- Red measurement lines + px value badges appear between them
|
|
179
|
+
- **Smart geometry:** side-by-side → horizontal gap; stacked → vertical gap;
|
|
180
|
+
diagonal → both gaps + dotted extension lines; overlapping → four inset distances
|
|
181
|
+
|
|
182
|
+
The overlay is editor-only chrome and never appears in the exported HTML/PDF.
|
|
183
|
+
|
|
184
|
+
### Canvas Zoom Shortcuts
|
|
185
|
+
|
|
186
|
+
Ctrl/⌘ + `+` / `-` / `0` zoom the canvas regardless of where focus sits — even
|
|
187
|
+
when the cursor is inside the editor iframe (where the browser would otherwise
|
|
188
|
+
hijack the shortcut for page zoom):
|
|
189
|
+
|
|
190
|
+
| Shortcut | Action |
|
|
191
|
+
| ------------------------- | ------------ |
|
|
192
|
+
| `Ctrl / ⌘ +` or `=` | Zoom in |
|
|
193
|
+
| `Ctrl / ⌘ -` | Zoom out |
|
|
194
|
+
| `Ctrl / ⌘ 0` | Reset to 100%|
|
|
195
|
+
| `Ctrl / ⌘ + mouse wheel` | Zoom in/out |
|
|
196
|
+
|
|
197
|
+
The zoom label in the toolbar stays in sync in real time.
|
|
198
|
+
|
|
199
|
+
### Inline Block Insert (`+` button)
|
|
200
|
+
|
|
201
|
+
A hover-activated **`+`** button appears on the left edge of the current
|
|
202
|
+
insertion line in flow-canvas mode. Clicking it opens a block picker and inserts
|
|
203
|
+
the chosen block at that exact position — the same create/place path used by
|
|
204
|
+
sidebar drag-and-drop.
|
|
205
|
+
|
|
206
|
+
### Rulers and Alignment Guides
|
|
207
|
+
|
|
208
|
+
Horizontal and vertical rulers line the canvas edge. Drag from either ruler to
|
|
209
|
+
create a **draggable alignment guide** that snaps blocks during positioning.
|
|
210
|
+
Toggle the feature via the `EditorFeatures.rulersGuides` flag:
|
|
211
|
+
|
|
212
|
+
```js
|
|
213
|
+
window.EditorFeatures = { rulersGuides: false }; // hide rulers + guides
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Image Cropper
|
|
217
|
+
|
|
218
|
+
Double-click an image block to enter crop mode — drag the crop handles to trim
|
|
219
|
+
the image, then confirm. The original asset is preserved; the crop is applied as
|
|
220
|
+
CSS `object-fit` / `object-position`, so re-cropping is always non-destructive.
|
|
221
|
+
|
|
222
|
+
### Image Frame Shape Picker
|
|
223
|
+
|
|
224
|
+
Images can be masked into custom shapes (circle, rounded rectangle, polygon,
|
|
225
|
+
star, and more) using the frame shape picker in the right Properties panel.
|
|
226
|
+
Switching shapes re-applies the mask without disturbing the image or crop state.
|
|
227
|
+
|
|
228
|
+
### Feature Flags
|
|
229
|
+
|
|
230
|
+
Every major sub-feature can be switched off without touching editor code:
|
|
231
|
+
|
|
232
|
+
```js
|
|
233
|
+
// Set BEFORE the editor loads (e.g. in a <script> tag before the import).
|
|
234
|
+
window.EditorFeatures = {
|
|
235
|
+
rulersGuides: false, // hide rulers + guides
|
|
236
|
+
measureDistance: false, // disable Figma-style distance overlay
|
|
237
|
+
zoomShortcuts: false, // disable Ctrl/⌘ zoom keyboard shortcuts
|
|
238
|
+
};
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
132
243
|
## API
|
|
133
244
|
|
|
134
245
|
### Properties
|
|
@@ -193,7 +304,10 @@ Edit the Angular UI under `src/app/` or the canvas engine under
|
|
|
193
304
|
|
|
194
305
|
## Licensing
|
|
195
306
|
|
|
196
|
-
This package is MIT licensed.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
307
|
+
This package is MIT licensed. The default rich-text engine (`useFroala: false`)
|
|
308
|
+
is fully self-contained and carries no third-party obligations.
|
|
309
|
+
|
|
310
|
+
If you opt in to `useFroala: true`, the editor loads the commercial **Froala**
|
|
311
|
+
WYSIWYG editor from a CDN at runtime; Froala production use requires a licence
|
|
312
|
+
from <https://froala.com>. The MIT licence here covers only the
|
|
313
|
+
`proposal-studio` code, not third-party Froala / jQuery / Font Awesome.
|