princess-python-editor 0.3.1 → 0.3.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 CHANGED
@@ -889,57 +889,3 @@ pnpm lint
889
889
  pnpm format
890
890
  pnpm typecheck
891
891
  ```
892
-
893
- ## 发布到 npm
894
-
895
- 发布前确认:
896
-
897
- 1. 包名 `princess-python-editor` 在 npm 上可用。
898
- 2. 已在 npm 官方源登录:`npm whoami --registry=https://registry.npmjs.org/`。
899
- 3. 代码已提交,工作区没有未提交改动(推荐)。
900
-
901
- ```bash
902
- # 1. 登录官方 npm(如果本机 registry 配置的是镜像,需要显式指定)
903
- npm login --registry=https://registry.npmjs.org/
904
-
905
- # 2. 更新版本号(会创建 commit 与 tag,也可手动修改 package.json)
906
- npm version patch # 或 minor / major
907
-
908
- # 3. 构建并检查将要发布的文件
909
- pnpm build
910
- npm pack --dry-run
911
-
912
- # 4. 发布(package.json 的 publishConfig 已指定官方 registry)
913
- npm publish --registry=https://registry.npmjs.org/
914
-
915
- # 5. 验证
916
- npm view princess-python-editor version --registry=https://registry.npmjs.org/
917
- ```
918
-
919
- 如果账号开启了 2FA,发布时需要提供动态验证码:
920
-
921
- ```bash
922
- npm publish --registry=https://registry.npmjs.org/ --otp=123456
923
- ```
924
-
925
- 如果希望发布时免验证码,可以创建 Granular Access Token,创建时必须:
926
-
927
- - 权限选择 `Read and write`,不能选 `Read and write (stage only)`
928
- - 勾选 `Bypass 2FA`
929
-
930
- 然后替换用户级 `~/.npmrc` 中的 Token:
931
-
932
- ```bash
933
- npm config set //registry.npmjs.org/:_authToken "npm_你的token"
934
- ```
935
-
936
- 说明:
937
-
938
- - `prepublishOnly` 会自动执行 `pnpm build`,无需手动构建。
939
- - npm 正在收紧 Bypass 2FA Token 的直接发布权限;CI 发布建议使用 Trusted Publishing (OIDC),或使用 stage-only Token 配合 `npm stage publish` 人工审批。
940
- - 如果包名被占用,可以改为作用域包,例如 `@your-scope/princess-python-editor`,并执行 `npm publish --access public`。
941
- - 发布后建议在空目录中执行 `npm i princess-python-editor` 做一次安装冒烟测试。
942
-
943
- ## License
944
-
945
- [MIT](LICENSE)
@@ -17,6 +17,8 @@ export interface Props {
17
17
  autofocus?: boolean;
18
18
  /** 是否显示工具栏 */
19
19
  showToolbar?: boolean;
20
+ /** 是否显示底部提交按钮,默认隐藏;点击后触发 submit 事件 */
21
+ showSubmit?: boolean;
20
22
  /** 是否显示工具栏新建按钮及 Tab 栏新建入口 */
21
23
  showNewFile?: boolean;
22
24
  /** 是否显示工具栏打开本地文件按钮 */
@@ -80,6 +82,8 @@ declare function openSqlConfig(): void;
80
82
  declare function closeSqlConfig(): void;
81
83
  /** 执行指定 SQL;不传参数时执行当前文件内容(会切换当前文件为 SQL) */
82
84
  declare function executeSql(sql?: string): Promise<SqlQueryResult | null>;
85
+ /** 提交当前代码,由宿主处理保存或业务请求 */
86
+ declare function submit(): void;
83
87
  /** 运行当前编辑器中的代码 */
84
88
  declare function run(): void;
85
89
  /** 中断当前文件的执行 */
@@ -133,6 +137,7 @@ declare function getFiles(): EditorFile[];
133
137
  /** 获取当前 Tab 文件快照 */
134
138
  declare function getActiveFile(): EditorFile;
135
139
  declare const _default: import('vue').DefineComponent<Props, {
140
+ submit: typeof submit;
136
141
  run: typeof run;
137
142
  stop: typeof stop;
138
143
  clearOutput: typeof clearOutput;
@@ -179,6 +184,7 @@ declare const _default: import('vue').DefineComponent<Props, {
179
184
  readOnly: boolean;
180
185
  autofocus: boolean;
181
186
  showToolbar: boolean;
187
+ showSubmit: boolean;
182
188
  showNewFile: boolean;
183
189
  showOpenFile: boolean;
184
190
  showDownload: boolean;
package/dist/icons.d.ts CHANGED
@@ -15,6 +15,8 @@ export declare const IconFile: FunctionalComponent<{}, {}, any, {}>;
15
15
  export declare const IconDownload: FunctionalComponent<{}, {}, any, {}>;
16
16
  /** 复制(双层纸张) */
17
17
  export declare const IconCopy: FunctionalComponent<{}, {}, any, {}>;
18
+ /** 发送(纸飞机) */
19
+ export declare const IconSend: FunctionalComponent<{}, {}, any, {}>;
18
20
  /** 对勾(复制成功反馈) */
19
21
  export declare const IconCheck: FunctionalComponent<{}, {}, any, {}>;
20
22
  /** 关闭(叉号) */