@gilav21/shadcn-angular-rte 0.1.1 → 0.2.0
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 +43 -27
- package/fesm2022/{gilav21-shadcn-angular-rte-docx-parser-CFx_4GC5.mjs → gilav21-shadcn-angular-rte-docx-parser-CdxuIlVT.mjs} +2 -2
- package/fesm2022/{gilav21-shadcn-angular-rte-docx-parser-CFx_4GC5.mjs.map → gilav21-shadcn-angular-rte-docx-parser-CdxuIlVT.mjs.map} +1 -1
- package/fesm2022/{gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-DWSBW7Gw.mjs → gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-BFcfCqW4.mjs} +933 -62
- package/fesm2022/gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-BFcfCqW4.mjs.map +1 -0
- package/fesm2022/gilav21-shadcn-angular-rte.mjs +1 -1
- package/package.json +6 -2
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.cjs +169 -0
- package/schematics/ng-add/schema.json +13 -0
- package/styles.css +2 -0
- package/types/gilav21-shadcn-angular-rte.d.ts +143 -3
- package/types/gilav21-shadcn-angular-rte.d.ts.map +1 -1
- package/fesm2022/gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-DWSBW7Gw.mjs.map +0 -1
- package/theme.css +0 -159
package/README.md
CHANGED
|
@@ -12,39 +12,54 @@ fixes.
|
|
|
12
12
|
- **Angular 20 or 21** (peer `>=20.0.0 <22.0.0`). Both majors are covered by
|
|
13
13
|
the e2e suite, which installs this package's real tarball into a pristine
|
|
14
14
|
Angular 20 app and a pristine Angular 21 app and builds both.
|
|
15
|
-
- **Tailwind CSS v4**.
|
|
16
15
|
- Works in zoneless apps.
|
|
16
|
+
- **No Tailwind required.** The package ships its styles precompiled; your app
|
|
17
|
+
does not need Tailwind, PostCSS or any CSS setup of its own.
|
|
17
18
|
|
|
18
19
|
## Install
|
|
19
20
|
|
|
20
21
|
```bash
|
|
21
|
-
|
|
22
|
-
npm install -D tailwindcss @tailwindcss/postcss postcss
|
|
22
|
+
ng add @gilav21/shadcn-angular-rte
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
That installs the package and registers its stylesheet in `angular.json`.
|
|
26
|
+
Nothing else to configure.
|
|
27
|
+
|
|
28
|
+
Can't run `ng add`? Install with npm and add the stylesheet to the `styles`
|
|
29
|
+
array of your app's build target yourself:
|
|
26
30
|
|
|
27
31
|
```json
|
|
28
|
-
|
|
32
|
+
"styles": ["@gilav21/shadcn-angular-rte/styles.css", "src/styles.css"]
|
|
29
33
|
```
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
### What the stylesheet does — and doesn't — touch
|
|
36
|
+
|
|
37
|
+
`styles.css` styles only the editor and its overlays. It does **not** restyle your app:
|
|
38
|
+
|
|
39
|
+
- Tailwind's reset is scoped to the package's own elements — your `body`,
|
|
40
|
+
headings and buttons keep their styles.
|
|
41
|
+
- The design tokens (`--primary`, `--background`, …) are declared at zero
|
|
42
|
+
specificity, so tokens your app already defines — for example from
|
|
43
|
+
`npx shadcn-angular init` — win.
|
|
44
|
+
- Apps that run their own Tailwind build are fine: the package's utilities
|
|
45
|
+
coexist with yours.
|
|
46
|
+
- Text uses **your app's font** — the package sets no `font-family` of its own,
|
|
47
|
+
so it matches your typography. An app with no font set shows the browser
|
|
48
|
+
default (usually a serif); set one on `body` (for example
|
|
49
|
+
`font-family: system-ui, sans-serif`) for the familiar shadcn look.
|
|
50
|
+
|
|
51
|
+
## Themes
|
|
32
52
|
|
|
33
|
-
|
|
53
|
+
`ui-rich-text-editor` takes a `theme` input with the same presets `npx shadcn-angular
|
|
54
|
+
change-theme` offers: `zinc`, `slate`, `stone`, `gray`, `neutral`, `red`, `rose`, `orange`, `green`, `blue`, `yellow`, `violet`, `amber`.
|
|
34
55
|
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
@source "../node_modules/@gilav21/shadcn-angular-rte";
|
|
38
|
-
@import "@gilav21/shadcn-angular-rte/theme.css";
|
|
56
|
+
```html
|
|
57
|
+
<ui-rich-text-editor theme="violet" … />
|
|
39
58
|
```
|
|
40
59
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- The `theme.css` import ships the design tokens (`:root` / `.dark` custom
|
|
45
|
-
properties, `@theme inline`, base layer). **Skip it if your app is already
|
|
46
|
-
CLI-initialised** (`npx shadcn-angular init` wrote the same tokens into your
|
|
47
|
-
own stylesheet, and importing both duplicates the `:root` block).
|
|
60
|
+
The preset applies to that instance only, including its menus, popovers,
|
|
61
|
+
tooltips and dialogs, and it follows `.dark` mode. Leave `theme` unset to
|
|
62
|
+
use your app's tokens.
|
|
48
63
|
|
|
49
64
|
## Usage
|
|
50
65
|
|
|
@@ -120,9 +135,9 @@ download only when a user actually imports a file.
|
|
|
120
135
|
## Locale, RTL and density
|
|
121
136
|
|
|
122
137
|
`[locale]` is set per editor instance (`locale="he"`), and RTL follows the
|
|
123
|
-
document direction. Density is driven by
|
|
124
|
-
|
|
125
|
-
|
|
138
|
+
document direction. Density is driven by CSS custom properties; override
|
|
139
|
+
`--density` (or `--density-rich-text-editor`) in your own stylesheet to scale
|
|
140
|
+
spacing.
|
|
126
141
|
|
|
127
142
|
## Selectors are fixed
|
|
128
143
|
|
|
@@ -152,13 +167,14 @@ uses. In practice:
|
|
|
152
167
|
|
|
153
168
|
## Troubleshooting
|
|
154
169
|
|
|
155
|
-
**Nothing is styled.** The
|
|
156
|
-
|
|
157
|
-
inside `node_modules`.
|
|
170
|
+
**Nothing is styled.** The stylesheet is not registered. Re-run `ng add @gilav21/shadcn-angular-rte`,
|
|
171
|
+
or check that `"@gilav21/shadcn-angular-rte/styles.css"` is in your build target's `styles` array.
|
|
158
172
|
|
|
159
|
-
**
|
|
160
|
-
|
|
161
|
-
|
|
173
|
+
**A package element looks off in my app.** Global rules your app declares
|
|
174
|
+
outside any `@layer` (say `button { padding: 1rem }`) beat the package's
|
|
175
|
+
styles, which live in cascade layers. Scope such rules to your own markup, or
|
|
176
|
+
put your global stylesheet in a layer. To restyle a package element on purpose,
|
|
177
|
+
pass classes through its `class` input.
|
|
162
178
|
|
|
163
179
|
**`npm install` fails with a peer error on `@angular/core`.** This package
|
|
164
180
|
supports Angular 20 and 21. On Angular 19 or older, use the CLI copy model
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate } from './gilav21-shadcn-angular-rte-inflate-laXxypva.mjs';
|
|
2
|
-
import { i as isValidImageMagicBytes } from './gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-
|
|
2
|
+
import { i as isValidImageMagicBytes } from './gilav21-shadcn-angular-rte-gilav21-shadcn-angular-rte-BFcfCqW4.mjs';
|
|
3
3
|
|
|
4
4
|
const DEFAULT_MAX_UNCOMPRESSED = 1024 * 1024 * 1024;
|
|
5
5
|
const DEFAULT_MAX_FILE_SIZE = 200 * 1024 * 1024;
|
|
@@ -1525,4 +1525,4 @@ function parseDocx(data) {
|
|
|
1525
1525
|
}
|
|
1526
1526
|
|
|
1527
1527
|
export { parseDocx };
|
|
1528
|
-
//# sourceMappingURL=gilav21-shadcn-angular-rte-docx-parser-
|
|
1528
|
+
//# sourceMappingURL=gilav21-shadcn-angular-rte-docx-parser-CdxuIlVT.mjs.map
|