@mutualendemic/pi-web-codemirror-editor 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mutualendemic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,22 @@
1
- # Temporary Holding Version
1
+ # PI WEB CodeMirror Editor plugin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Adds a manual **Edit** preview to PI WEB's existing **Files** panel. Choose **Edit** for a supported text file to edit and save it in the current workspace using CodeMirror 6, an open-source editor published under the MIT license. The editor code loads only when **Edit** is selected. Editing and saving stay in the browser/workspace transport; file contents are not sent to an editor service.
4
+
5
+ The preview is limited to non-binary, non-truncated files up to 2 MiB. It includes syntax support for JavaScript/TypeScript, JSON, CSS, HTML, Python, Markdown, YAML, SQL, Rust, XML, C/C++, Java, and Go. Before saving, the plugin checks whether the file's modification time changed since it was opened and asks for an explicit **Overwrite** action when it detects a conflict. That check is advisory (the host write API does not provide an atomic compare-and-swap).
6
+
7
+ ## Install from npm
8
+
9
+ After publication, install `@mutualendemic/pi-web-codemirror-editor` through **Settings → Pi packages**. Then enable **CodeMirror Editor** in **Settings → PI WEB plugins** and reload the browser. The plugin is browser-only; no session-daemon restart is required.
10
+
11
+ ## Build and install locally
12
+
13
+ ```sh
14
+ npm install
15
+ npm run build
16
+ mkdir -p "${PI_WEB_DATA_DIR:-$HOME/.pi-web}/plugins"
17
+ ln -s "$PWD" "${PI_WEB_DATA_DIR:-$HOME/.pi-web}/plugins/codemirror-editor"
18
+ ```
19
+
20
+ Enable **CodeMirror Editor** in **Settings → PI WEB plugins**, then reload the browser. This is a browser-only plugin; rebuilding or changing it does not require a session-daemon restart. The PI WEB host must support browser plugin API v5 and the `stylesheet-integration` v1 capability.
21
+
22
+ For local development, rebuild after source changes and reload the browser. The package's `dist/browser` directory is the only public asset root; do not put secrets there.