@webjourney/vite-plugins 1.0.1 → 1.0.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 +1 -1
- package/README.md +0 -66
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# @webjourney/vite-plugins
|
|
2
|
-
|
|
3
|
-
Vite plugins for Webjourney WYSIWYG editing functionality.
|
|
4
|
-
|
|
5
|
-
## Requirements
|
|
6
|
-
|
|
7
|
-
- Vite 5.x, 6.x, or 7.x
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
yarn add @webjourney/vite-plugins
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Or with npm:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install @webjourney/vite-plugins
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
In your `vite.config.ts`:
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
import { defineConfig } from 'vite';
|
|
27
|
-
import { webjourneyPlugins } from '@webjourney/vite-plugins';
|
|
28
|
-
|
|
29
|
-
export default defineConfig({
|
|
30
|
-
plugins: [
|
|
31
|
-
...webjourneyPlugins(), // Must run BEFORE react() to see original JSX
|
|
32
|
-
// ... other plugins
|
|
33
|
-
],
|
|
34
|
-
});
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## What it does
|
|
38
|
-
|
|
39
|
-
This package provides Vite plugins that enable WYSIWYG editing in Webjourney:
|
|
40
|
-
|
|
41
|
-
1. **`webjourneyElementTagger()`** - Injects source mapping attributes (`data-wj-*`) into JSX elements for tracking
|
|
42
|
-
2. **`webjourneyPluginScript()`** - Injects the Webjourney plugin script into the HTML head
|
|
43
|
-
3. **`webjourneyPlugins()`** - Convenience function that returns an array of the above plugins
|
|
44
|
-
|
|
45
|
-
## Features
|
|
46
|
-
|
|
47
|
-
- Automatically adds `data-wj-file`, `data-wj-line`, `data-wj-type`, and `data-wj-id` attributes to text and image elements
|
|
48
|
-
- Only runs in development mode for performance
|
|
49
|
-
- Zero runtime overhead in production builds
|
|
50
|
-
|
|
51
|
-
## Development
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
# Build the package
|
|
55
|
-
yarn build
|
|
56
|
-
|
|
57
|
-
# Watch mode
|
|
58
|
-
yarn dev
|
|
59
|
-
|
|
60
|
-
# Type check
|
|
61
|
-
yarn typecheck
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## License
|
|
65
|
-
|
|
66
|
-
Private - Webjourney internal use only
|