extension-create 2.0.0-alpha.23 → 2.0.0-alpha.24
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/dist/module.js +3 -3
- package/dist/test-template-action/README.md +35 -0
- package/dist/test-template-action/action/index.html +40 -0
- package/dist/test-template-action/action/scripts.js +11 -0
- package/dist/test-template-action/action/styles.css +23 -0
- package/dist/test-template-action/images/extension_128.png +0 -0
- package/dist/test-template-action/images/extension_16.png +0 -0
- package/dist/test-template-action/images/extension_48.png +0 -0
- package/dist/test-template-action/manifest.json +21 -0
- package/dist/test-template-action/package.json +21 -0
- package/dist/test-template-action-chatgpt/.env.example +1 -0
- package/dist/test-template-action-chatgpt/README.md +35 -0
- package/dist/test-template-action-chatgpt/action/ActionApp.tsx +118 -0
- package/dist/test-template-action-chatgpt/action/index.html +13 -0
- package/dist/test-template-action-chatgpt/action/scripts.tsx +12 -0
- package/dist/test-template-action-chatgpt/action/styles.css +8 -0
- package/dist/test-template-action-chatgpt/images/chatgpt.png +0 -0
- package/dist/test-template-action-chatgpt/images/extension.png +0 -0
- package/dist/test-template-action-chatgpt/images/extension_128.png +0 -0
- package/dist/test-template-action-chatgpt/images/extension_16.png +0 -0
- package/dist/test-template-action-chatgpt/images/extension_48.png +0 -0
- package/dist/test-template-action-chatgpt/manifest.json +21 -0
- package/dist/test-template-action-chatgpt/package.json +30 -0
- package/dist/test-template-action-chatgpt/postcss.config.js +6 -0
- package/dist/test-template-action-chatgpt/tailwind.config.js +8 -0
- package/dist/test-template-action-chatgpt/tsconfig.json +22 -0
- package/dist/test-template-config-stylelint/README.md +35 -0
- package/dist/test-template-config-stylelint/images/extension_128.png +0 -0
- package/dist/test-template-config-stylelint/images/extension_16.png +0 -0
- package/dist/test-template-config-stylelint/images/extension_48.png +0 -0
- package/dist/test-template-config-stylelint/images/stylelint.svg +1 -0
- package/dist/test-template-config-stylelint/manifest.json +15 -0
- package/dist/test-template-config-stylelint/newtab/index.html +40 -0
- package/dist/test-template-config-stylelint/newtab/scripts.js +11 -0
- package/dist/test-template-config-stylelint/newtab/styles.css +20 -0
- package/dist/test-template-config-stylelint/package.json +23 -0
- package/dist/test-template-config-stylelint/stylelint.config.json +1 -0
- package/dist/test-template-content/README.md +35 -0
- package/dist/test-template-content/background.js +21 -0
- package/dist/test-template-content/content/scripts.js +32 -0
- package/dist/test-template-content/content/styles.css +54 -0
- package/dist/test-template-content/images/extension_128.png +0 -0
- package/dist/test-template-content/images/extension_16.png +0 -0
- package/dist/test-template-content/images/extension_48.png +0 -0
- package/dist/test-template-content/manifest.json +35 -0
- package/dist/test-template-content/package.json +20 -0
- package/dist/test-template-content-css-module/README.md +35 -0
- package/dist/test-template-content-css-module/background.js +21 -0
- package/dist/test-template-content-css-module/content/Logo.module.css +11 -0
- package/dist/test-template-content-css-module/content/scripts.js +33 -0
- package/dist/test-template-content-css-module/content/styles.css +40 -0
- package/dist/test-template-content-css-module/images/extension_128.png +0 -0
- package/dist/test-template-content-css-module/images/extension_16.png +0 -0
- package/dist/test-template-content-css-module/images/extension_48.png +0 -0
- package/dist/test-template-content-css-module/manifest.json +35 -0
- package/dist/test-template-content-css-module/package.json +20 -0
- package/dist/test-template-content-less/README.md +35 -0
- package/dist/test-template-content-less/background.js +21 -0
- package/dist/test-template-content-less/content/scripts.js +32 -0
- package/dist/test-template-content-less/content/styles.less +51 -0
- package/dist/test-template-content-less/images/extension_128.png +0 -0
- package/dist/test-template-content-less/images/extension_16.png +0 -0
- package/dist/test-template-content-less/images/extension_48.png +0 -0
- package/dist/test-template-content-less/manifest.json +35 -0
- package/dist/test-template-content-less/package.json +21 -0
- package/dist/test-template-content-main-world/README.md +35 -0
- package/dist/test-template-content-main-world/background.js +1 -0
- package/dist/test-template-content-main-world/content/scripts.js +20 -0
- package/dist/test-template-content-main-world/content/styles.css +46 -0
- package/dist/test-template-content-main-world/extension.config.js +8 -0
- package/dist/test-template-content-main-world/images/extension_128.png +0 -0
- package/dist/test-template-content-main-world/images/extension_16.png +0 -0
- package/dist/test-template-content-main-world/images/extension_48.png +0 -0
- package/dist/test-template-content-main-world/manifest.json +37 -0
- package/dist/test-template-content-main-world/package.json +20 -0
- package/dist/test-template-content-preact/README.md +35 -0
- package/dist/test-template-content-preact/background.ts +1 -0
- package/dist/test-template-content-preact/content/ContentApp.tsx +92 -0
- package/dist/test-template-content-preact/content/scripts.tsx +14 -0
- package/dist/test-template-content-preact/content/styles.css +10 -0
- package/dist/test-template-content-preact/images/chromeWindow.png +0 -0
- package/dist/test-template-content-preact/images/extension_128.png +0 -0
- package/dist/test-template-content-preact/images/extension_16.png +0 -0
- package/dist/test-template-content-preact/images/extension_48.png +0 -0
- package/dist/test-template-content-preact/images/preact.png +0 -0
- package/dist/test-template-content-preact/images/tailwind.png +0 -0
- package/dist/test-template-content-preact/images/tailwind_bg.png +0 -0
- package/dist/test-template-content-preact/images/typescript.png +0 -0
- package/dist/test-template-content-preact/manifest.json +31 -0
- package/dist/test-template-content-preact/package.json +29 -0
- package/dist/test-template-content-preact/postcss.config.js +6 -0
- package/dist/test-template-content-preact/tailwind.config.js +8 -0
- package/dist/test-template-content-preact/tsconfig.json +27 -0
- package/dist/test-template-content-react/README.md +35 -0
- package/dist/test-template-content-react/background.ts +1 -0
- package/dist/test-template-content-react/content/ContentApp.tsx +86 -0
- package/dist/test-template-content-react/content/scripts.tsx +17 -0
- package/dist/test-template-content-react/content/styles.css +10 -0
- package/dist/test-template-content-react/images/chromeWindow.png +0 -0
- package/dist/test-template-content-react/images/extension_128.png +0 -0
- package/dist/test-template-content-react/images/extension_16.png +0 -0
- package/dist/test-template-content-react/images/extension_48.png +0 -0
- package/dist/test-template-content-react/images/react.png +0 -0
- package/dist/test-template-content-react/images/tailwind.png +0 -0
- package/dist/test-template-content-react/images/tailwind_bg.png +0 -0
- package/dist/test-template-content-react/images/typescript.png +0 -0
- package/dist/test-template-content-react/manifest.json +28 -0
- package/dist/test-template-content-react/package.json +28 -0
- package/dist/test-template-content-react/postcss.config.js +6 -0
- package/dist/test-template-content-react/tailwind.config.js +8 -0
- package/dist/test-template-content-react/tsconfig.json +22 -0
- package/dist/test-template-content-sass/README.md +35 -0
- package/dist/test-template-content-sass/background.js +21 -0
- package/dist/test-template-content-sass/content/scripts.js +32 -0
- package/dist/test-template-content-sass/content/styles.scss +51 -0
- package/dist/test-template-content-sass/images/extension_128.png +0 -0
- package/dist/test-template-content-sass/images/extension_16.png +0 -0
- package/dist/test-template-content-sass/images/extension_48.png +0 -0
- package/dist/test-template-content-sass/manifest.json +35 -0
- package/dist/test-template-content-sass/package.json +21 -0
- package/dist/test-template-content-sass-module/README.md +35 -0
- package/dist/test-template-content-sass-module/background.js +21 -0
- package/dist/test-template-content-sass-module/content/Logo.module.scss +18 -0
- package/dist/test-template-content-sass-module/content/scripts.js +33 -0
- package/dist/test-template-content-sass-module/content/styles.scss +40 -0
- package/dist/test-template-content-sass-module/images/extension_128.png +0 -0
- package/dist/test-template-content-sass-module/images/extension_16.png +0 -0
- package/dist/test-template-content-sass-module/images/extension_48.png +0 -0
- package/dist/test-template-content-sass-module/manifest.json +35 -0
- package/dist/test-template-content-sass-module/package.json +21 -0
- package/dist/test-template-content-tailwind/README.md +35 -0
- package/dist/test-template-content-tailwind/background.js +21 -0
- package/dist/test-template-content-tailwind/content/content.js +45 -0
- package/dist/test-template-content-tailwind/content/scripts.js +6 -0
- package/dist/test-template-content-tailwind/content/styles.css +10 -0
- package/dist/test-template-content-tailwind/images/chromeWindow.png +0 -0
- package/dist/test-template-content-tailwind/images/extension_128.png +0 -0
- package/dist/test-template-content-tailwind/images/extension_16.png +0 -0
- package/dist/test-template-content-tailwind/images/extension_48.png +0 -0
- package/dist/test-template-content-tailwind/images/react.png +0 -0
- package/dist/test-template-content-tailwind/images/tailwind.png +0 -0
- package/dist/test-template-content-tailwind/images/tailwind_bg.png +0 -0
- package/dist/test-template-content-tailwind/manifest.json +35 -0
- package/dist/test-template-content-tailwind/package.json +23 -0
- package/dist/test-template-content-tailwind/postcss.config.js +6 -0
- package/dist/test-template-content-tailwind/tailwind.config.js +8 -0
- package/dist/test-template-content-typescript/README.md +35 -0
- package/dist/test-template-content-typescript/background.ts +26 -0
- package/dist/test-template-content-typescript/content/scripts.ts +33 -0
- package/dist/test-template-content-typescript/content/styles.css +51 -0
- package/dist/test-template-content-typescript/images/extension_128.png +0 -0
- package/dist/test-template-content-typescript/images/extension_16.png +0 -0
- package/dist/test-template-content-typescript/images/extension_48.png +0 -0
- package/dist/test-template-content-typescript/images/typescript.png +0 -0
- package/dist/test-template-content-typescript/manifest.json +35 -0
- package/dist/test-template-content-typescript/package.json +21 -0
- package/dist/test-template-content-typescript/tsconfig.json +22 -0
- package/dist/test-template-content-vue/README.md +35 -0
- package/dist/test-template-content-vue/background.ts +1 -0
- package/dist/test-template-content-vue/content/ContentApp.vue +90 -0
- package/dist/test-template-content-vue/content/scripts.ts +13 -0
- package/dist/test-template-content-vue/content/shims-vue.d.ts +6 -0
- package/dist/test-template-content-vue/content/styles.css +10 -0
- package/dist/test-template-content-vue/images/chromeWindow.png +0 -0
- package/dist/test-template-content-vue/images/extension_128.png +0 -0
- package/dist/test-template-content-vue/images/extension_16.png +0 -0
- package/dist/test-template-content-vue/images/extension_48.png +0 -0
- package/dist/test-template-content-vue/images/tailwind.png +0 -0
- package/dist/test-template-content-vue/images/tailwind_bg.png +0 -0
- package/dist/test-template-content-vue/images/typescript.png +0 -0
- package/dist/test-template-content-vue/images/vue.svg +8 -0
- package/dist/test-template-content-vue/manifest.json +31 -0
- package/dist/test-template-content-vue/package.json +25 -0
- package/dist/test-template-content-vue/postcss.config.js +6 -0
- package/dist/test-template-content-vue/tailwind.config.js +8 -0
- package/dist/test-template-content-vue/tsconfig.json +22 -0
- package/dist/test-template-declarative_net_request/README.md +35 -0
- package/dist/test-template-declarative_net_request/images/extension_128.png +0 -0
- package/dist/test-template-declarative_net_request/images/extension_16.png +0 -0
- package/dist/test-template-declarative_net_request/images/extension_48.png +0 -0
- package/dist/test-template-declarative_net_request/manifest.json +34 -0
- package/dist/test-template-declarative_net_request/package.json +21 -0
- package/dist/test-template-declarative_net_request/public/public_ruleset.json +72 -0
- package/dist/test-template-declarative_net_request/rules_1.json +72 -0
- package/dist/test-template-init/README.md +35 -0
- package/dist/test-template-init/manifest.json +7 -0
- package/dist/test-template-init/package.json +32 -0
- package/dist/test-template-locales/README.md +35 -0
- package/dist/test-template-locales/_locales/en/messages.json +10 -0
- package/dist/test-template-locales/_locales/pt_BR/messages.json +10 -0
- package/dist/test-template-locales/action/index.html +40 -0
- package/dist/test-template-locales/action/scripts.js +3 -0
- package/dist/test-template-locales/action/styles.css +23 -0
- package/dist/test-template-locales/images/extension_128.png +0 -0
- package/dist/test-template-locales/images/extension_16.png +0 -0
- package/dist/test-template-locales/images/extension_48.png +0 -0
- package/dist/test-template-locales/manifest.json +19 -0
- package/dist/test-template-locales/package.json +21 -0
- package/dist/test-template-new-less/README.md +35 -0
- package/dist/test-template-new-less/images/extension_128.png +0 -0
- package/dist/test-template-new-less/images/extension_16.png +0 -0
- package/dist/test-template-new-less/images/extension_48.png +0 -0
- package/dist/test-template-new-less/manifest.json +15 -0
- package/dist/test-template-new-less/newtab/index.html +40 -0
- package/dist/test-template-new-less/newtab/scripts.js +11 -0
- package/dist/test-template-new-less/newtab/styles.less +19 -0
- package/dist/test-template-new-less/package.json +21 -0
- package/dist/test-template-new-preact/README.md +35 -0
- package/dist/test-template-new-preact/images/extension_128.png +0 -0
- package/dist/test-template-new-preact/images/extension_16.png +0 -0
- package/dist/test-template-new-preact/images/extension_48.png +0 -0
- package/dist/test-template-new-preact/images/preact.png +0 -0
- package/dist/test-template-new-preact/manifest.json +15 -0
- package/dist/test-template-new-preact/newtab/NewTabApp.tsx +27 -0
- package/dist/test-template-new-preact/newtab/index.html +13 -0
- package/dist/test-template-new-preact/newtab/scripts.tsx +5 -0
- package/dist/test-template-new-preact/newtab/styles.css +32 -0
- package/dist/test-template-new-preact/package.json +29 -0
- package/dist/test-template-new-preact/tsconfig.json +22 -0
- package/dist/test-template-new-react/README.md +35 -0
- package/dist/test-template-new-react/images/extension_128.png +0 -0
- package/dist/test-template-new-react/images/extension_16.png +0 -0
- package/dist/test-template-new-react/images/extension_48.png +0 -0
- package/dist/test-template-new-react/images/react.png +0 -0
- package/dist/test-template-new-react/manifest.json +15 -0
- package/dist/test-template-new-react/newtab/NewTabApp.tsx +27 -0
- package/dist/test-template-new-react/newtab/index.html +13 -0
- package/dist/test-template-new-react/newtab/scripts.tsx +12 -0
- package/dist/test-template-new-react/newtab/styles.css +23 -0
- package/dist/test-template-new-react/package.json +28 -0
- package/dist/test-template-new-react/tsconfig.json +22 -0
- package/dist/test-template-new-sass/README.md +35 -0
- package/dist/test-template-new-sass/images/extension_128.png +0 -0
- package/dist/test-template-new-sass/images/extension_16.png +0 -0
- package/dist/test-template-new-sass/images/extension_48.png +0 -0
- package/dist/test-template-new-sass/manifest.json +15 -0
- package/dist/test-template-new-sass/newtab/index.html +40 -0
- package/dist/test-template-new-sass/newtab/scripts.js +11 -0
- package/dist/test-template-new-sass/newtab/styles.scss +19 -0
- package/dist/test-template-new-sass/package.json +22 -0
- package/dist/test-template-new-tailwind/README.md +35 -0
- package/dist/test-template-new-tailwind/images/chromeWindow.png +0 -0
- package/dist/test-template-new-tailwind/images/extension_128.png +0 -0
- package/dist/test-template-new-tailwind/images/extension_16.png +0 -0
- package/dist/test-template-new-tailwind/images/extension_48.png +0 -0
- package/dist/test-template-new-tailwind/images/react.png +0 -0
- package/dist/test-template-new-tailwind/images/tailwind.png +0 -0
- package/dist/test-template-new-tailwind/images/tailwind_bg.png +0 -0
- package/dist/test-template-new-tailwind/manifest.json +15 -0
- package/dist/test-template-new-tailwind/newtab/NewTabApp.tsx +67 -0
- package/dist/test-template-new-tailwind/newtab/index.html +13 -0
- package/dist/test-template-new-tailwind/newtab/scripts.tsx +12 -0
- package/dist/test-template-new-tailwind/newtab/styles.css +3 -0
- package/dist/test-template-new-tailwind/package.json +28 -0
- package/dist/test-template-new-tailwind/postcss.config.js +6 -0
- package/dist/test-template-new-tailwind/tailwind.config.js +8 -0
- package/dist/test-template-new-tailwind/tsconfig.json +22 -0
- package/dist/test-template-new-typescript/README.md +35 -0
- package/dist/test-template-new-typescript/images/extension_128.png +0 -0
- package/dist/test-template-new-typescript/images/extension_16.png +0 -0
- package/dist/test-template-new-typescript/images/extension_48.png +0 -0
- package/dist/test-template-new-typescript/images/typescript.png +0 -0
- package/dist/test-template-new-typescript/manifest.json +15 -0
- package/dist/test-template-new-typescript/newtab/index.html +25 -0
- package/dist/test-template-new-typescript/newtab/scripts.ts +10 -0
- package/dist/test-template-new-typescript/newtab/styles.css +18 -0
- package/dist/test-template-new-typescript/package.json +22 -0
- package/dist/test-template-new-typescript/tsconfig.json +22 -0
- package/dist/test-template-new-vue/README.md +35 -0
- package/dist/test-template-new-vue/images/extension_128.png +0 -0
- package/dist/test-template-new-vue/images/extension_16.png +0 -0
- package/dist/test-template-new-vue/images/extension_48.png +0 -0
- package/dist/test-template-new-vue/images/vue.svg +8 -0
- package/dist/test-template-new-vue/manifest.json +15 -0
- package/dist/test-template-new-vue/newtab/NewTabApp.vue +30 -0
- package/dist/test-template-new-vue/newtab/index.html +13 -0
- package/dist/test-template-new-vue/newtab/scripts.ts +7 -0
- package/dist/test-template-new-vue/newtab/styles.css +36 -0
- package/dist/test-template-new-vue/package.json +25 -0
- package/dist/test-template-new-vue/tsconfig.json +22 -0
- package/dist/test-template-sidebar/README.md +35 -0
- package/dist/test-template-sidebar/images/extension_128.png +0 -0
- package/dist/test-template-sidebar/images/extension_16.png +0 -0
- package/dist/test-template-sidebar/images/extension_48.png +0 -0
- package/dist/test-template-sidebar/manifest.json +37 -0
- package/dist/test-template-sidebar/package.json +21 -0
- package/dist/test-template-sidebar/puzzle.png +0 -0
- package/dist/test-template-sidebar/sidebar/index.html +39 -0
- package/dist/test-template-sidebar/sidebar/scripts.js +11 -0
- package/dist/test-template-sidebar/sidebar/styles.css +27 -0
- package/dist/test-template-sidebar/test_16.png +0 -0
- package/dist/test-template-sidebar/test_32.png +0 -0
- package/dist/test-template-sidebar/test_48.png +0 -0
- package/dist/test-template-sidebar/test_64.png +0 -0
- package/dist/test-template-special-folders-pages/README.md +35 -0
- package/dist/test-template-special-folders-pages/background.js +5 -0
- package/dist/test-template-special-folders-pages/images/extension_128.png +0 -0
- package/dist/test-template-special-folders-pages/images/extension_16.png +0 -0
- package/dist/test-template-special-folders-pages/images/extension_48.png +0 -0
- package/dist/test-template-special-folders-pages/images/notpublic-file.png +0 -0
- package/dist/test-template-special-folders-pages/manifest.json +26 -0
- package/dist/test-template-special-folders-pages/package.json +21 -0
- package/dist/test-template-special-folders-pages/pages/custom.html +8 -0
- package/dist/test-template-special-folders-pages/pages/main.css +18 -0
- package/dist/test-template-special-folders-pages/pages/main.html +16 -0
- package/dist/test-template-special-folders-pages/pages/main.js +1 -0
- package/dist/test-template-special-folders-pages/public/css/file.css +3 -0
- package/dist/test-template-special-folders-pages/public/html/file.html +8 -0
- package/dist/test-template-special-folders-pages/public/img/icon.png +0 -0
- package/dist/test-template-special-folders-pages/public/js/file.js +0 -0
- package/dist/test-template-special-folders-pages/sandbox/index.html +24 -0
- package/dist/test-template-special-folders-pages/sandbox/scripts.js +0 -0
- package/dist/test-template-special-folders-pages/sandbox/styles.css +1 -0
- package/dist/test-template-special-folders-scripts/README.md +35 -0
- package/dist/test-template-special-folders-scripts/background.js +24 -0
- package/dist/test-template-special-folders-scripts/images/extension_128.png +0 -0
- package/dist/test-template-special-folders-scripts/images/extension_16.png +0 -0
- package/dist/test-template-special-folders-scripts/images/extension_48.png +0 -0
- package/dist/test-template-special-folders-scripts/manifest.json +27 -0
- package/dist/test-template-special-folders-scripts/package.json +21 -0
- package/dist/test-template-special-folders-scripts/pages/index.css +5 -0
- package/dist/test-template-special-folders-scripts/pages/index.html +3 -0
- package/dist/test-template-special-folders-scripts/pages/index.js +1 -0
- package/dist/test-template-special-folders-scripts/public/extension.png +0 -0
- package/dist/test-template-special-folders-scripts/scripts/content-script.js +3 -0
- package/dist/test-template-storage/README.md +35 -0
- package/dist/test-template-storage/images/extension_128.png +0 -0
- package/dist/test-template-storage/images/extension_16.png +0 -0
- package/dist/test-template-storage/images/extension_48.png +0 -0
- package/dist/test-template-storage/manifest.json +15 -0
- package/dist/test-template-storage/package.json +21 -0
- package/dist/test-template-storage/schema.json +44 -0
- package/package.json +3 -3
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ve=Object.create;var k=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Ue=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty;var qe=(e,n)=>{for(var o in n)k(e,o,{get:n[o],enumerable:!0})},j=(e,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Le(n))!Ye.call(e,i)&&i!==o&&k(e,i,{get:()=>n[i],enumerable:!(r=Xe(n,i))||r.enumerable});return e};var a=(e,n,o)=>(o=e!=null?Ve(Ue(e)):{},j(n||!e||!e.__esModule?k(o,"default",{value:e,enumerable:!0}):o,e)),He=e=>j(k({},"__esModule",{value:!0}),e);var mn={};qe(mn,{extensionCreate:()=>ln});module.exports=He(mn);var C=a(require("path"));var x=a(require("path")),t=require("@colors/colors/safe"),A=a(require("fs/promises")),G=require("
|
|
1
|
+
"use strict";var Ve=Object.create;var k=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Ue=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty;var qe=(e,n)=>{for(var o in n)k(e,o,{get:n[o],enumerable:!0})},j=(e,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Le(n))!Ye.call(e,i)&&i!==o&&k(e,i,{get:()=>n[i],enumerable:!(r=Xe(n,i))||r.enumerable});return e};var a=(e,n,o)=>(o=e!=null?Ve(Ue(e)):{},j(n||!e||!e.__esModule?k(o,"default",{value:e,enumerable:!0}):o,e)),He=e=>j(k({},"__esModule",{value:!0}),e);var mn={};qe(mn,{extensionCreate:()=>ln});module.exports=He(mn);var C=a(require("path"));var x=a(require("path")),t=require("@colors/colors/safe"),A=a(require("fs/promises")),G=require("package-manager-detector");function O(e){let n=x.default.basename(e);return`${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} Failed to write in the destination directory
|
|
2
2
|
|
|
3
3
|
Path is not writable. Ensure you have write permissions for this folder.
|
|
4
4
|
${(0,t.red)("NOT WRITEABLE")}: ${(0,t.underline)(n)}`}async function W(e,n){let o=x.default.basename(e),r=`
|
|
@@ -9,7 +9,7 @@ Conflict! Path to ${(0,t.cyan)(o)} includes conflicting files:
|
|
|
9
9
|
`}return r+=`
|
|
10
10
|
You need to either rename/remove the files listed above, or choose a new directory name for your extension.
|
|
11
11
|
|
|
12
|
-
Path to conflicting directory: ${(0,t.underline)(e)}`,r}function z(){return`${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} You need to provide an extension name to create one. See ${(0,t.brightYellow)("--help")} for command info.`}function V(){return`${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} URLs are not allowed as a project path. Either write a name or a path to a local folder.`}async function X(e,n){let o=x.default.relative(process.cwd(),e),r=await(0,G.detect)(),i="npm run";switch(r){case"yarn":i="yarn dev";break;case"pnpm":i="pnpm dev";break;default:i="npm run dev"}return process.env.npm_config_user_agent&&process.env.npm_config_user_agent.includes("pnpm")&&(i="pnpm dev"),`\u{1F9E9} - ${(0,t.brightGreen)("Success!")} Extension ${(0,t.cyan)(n)} created.
|
|
12
|
+
Path to conflicting directory: ${(0,t.underline)(e)}`,r}function z(){return`${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} You need to provide an extension name to create one. See ${(0,t.brightYellow)("--help")} for command info.`}function V(){return`${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} URLs are not allowed as a project path. Either write a name or a path to a local folder.`}async function X(e,n){let o=x.default.relative(process.cwd(),e),r=await(0,G.detect)(),i="npm run";switch(r?.name){case"yarn":i="yarn dev";break;case"pnpm":i="pnpm dev";break;default:i="npm run dev"}return process.env.npm_config_user_agent&&process.env.npm_config_user_agent.includes("pnpm")&&(i="pnpm dev"),`\u{1F9E9} - ${(0,t.brightGreen)("Success!")} Extension ${(0,t.cyan)(n)} created.
|
|
13
13
|
|
|
14
14
|
Now ${(0,t.magenta)(`cd ${(0,t.underline)(o)}`)} and ${(0,t.magenta)(`${i}`)} to open a new browser instance
|
|
15
15
|
with your extension installed, loaded, and enabled for development.
|
|
@@ -25,7 +25,7 @@ ${(0,t.red)(n.message||n.toString())}`}function oe(){return"Symlink created succ
|
|
|
25
25
|
${(0,t.red)(n)}`}function le(){return`\u{1F4DC} - Writing ${(0,t.brightYellow)("manifest.json")} metadata...`}function me(e,n){return`${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} Can't write ${(0,t.brightYellow)("manifest.json")} for ${(0,t.cyan)(e)}:
|
|
26
26
|
${(0,t.red)(n)}`}function pe(){return`\u{1F4C4} - Writing ${(0,t.brightYellow)("README.md")} metadata...`}function ge(){return`\u{1F648} - Writing ${(0,t.brightYellow)(".gitignore")} lines...`}function de(e,n){return`${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} Can't write the ${(0,t.brightYellow)("README.md")} file for ${(0,t.cyan)(e)}:
|
|
27
27
|
${(0,t.red)(n)}`}function fe(e){return`\u{1F91D} - Ensuring ${(0,t.cyan)(e)} folder exists...`}function ue(e){return`${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")} Error while checking directory writability:
|
|
28
|
-
`+(0,t.red)(e)}var E=a(require("fs/promises")),$=a(require("path")),we=require("
|
|
28
|
+
`+(0,t.red)(e)}var E=a(require("fs/promises")),$=a(require("path")),we=require("package-manager-detector");async function _(e,n){let o=await E.default.readdir(e,{withFileTypes:!0});return await E.default.mkdir(n,{recursive:!0}),await Promise.all(o.map(async r=>{let i=$.default.join(e,r.name),s=$.default.join(n,r.name);r.isDirectory()?await _(i,s):await E.default.copyFile(i,s)}))}async function y(){let e=await(0,we.detect)(),n="npm";if(process.env.npm_config_user_agent&&process.env.npm_config_user_agent.includes("pnpm"))return"pnpm";switch(e?.name){case"yarn":n="yarn";break;case"pnpm":n="pnpm";break;default:n="npm"}return n}function ye(e){let n=$.default.resolve(__dirname,"template");return $.default.resolve(e,n)}async function xe(e,n){try{return console.log(fe(n)),await E.default.mkdir(e,{recursive:!0}),!0}catch(o){return console.log(ue(o)),!1}}function he(e){return e!=="init"}function Ee(e){return e.includes("typescript")||e.includes("react")||e.includes("preact")||e.includes("svelte")||e.includes("solid")}var $e=a(require("path")),S=a(require("fs/promises"));var Be=["LICENSE","node_modules"];async function ve(e,n){console.log(L(n));try{let o=await xe(e,n);console.log(U()),o||(console.error(O(e)),process.exit(1));let r=await S.default.readdir(e);console.log(Y());let i=await Promise.all(r.filter(s=>!s.startsWith(".")).filter(s=>!s.endsWith(".log")).filter(s=>!Be.includes(s)).map(async s=>(await S.default.lstat($e.default.join(e,s))).isDirectory()?`${s}/`:`${s}`));if(i.length>0){let s=await W(e,i);throw new Error(s)}}catch(o){console.error(q(n,o)),process.exit(1)}}var ke=a(require("path"));async function be(e,n,o){let r=ke.default.resolve(__dirname,"template");try{console.log(h(n,o)),await _(r,e)}catch(i){console.error(b(n,o,i)),process.exit(1)}}var p=a(require("path")),f=a(require("fs/promises")),De=a(require("go-git-it"));async function Fe(e,n,o){let r=p.default.dirname(e),i=p.default.basename(o),c=`https://github.com/extension-js/extension.js/tree/main/examples/${o}`;try{await f.default.mkdir(e,{recursive:!0});let l="";if(process.env.EXTENSION_ENV==="development"?(console.log(h(n,o)),l=p.default.join(e,i),await f.default.cp(p.default.join(__dirname,"..","..","..","examples",i),l,{recursive:!0})):(await(0,De.default)(c,r,h(n,i)),l=p.default.join(r,i)),n!==i){let m=p.default.join(r,n);await f.default.mkdir(m,{recursive:!0});let g=await f.default.readdir(l);for(let u of g)await f.default.rename(p.default.join(l,u),p.default.join(m,u));await f.default.rm(l,{recursive:!0,force:!0})}else{let m=p.default.join(r,n+"-temp");await f.default.rename(l,m);let g=p.default.join(m,i),u=p.default.join(r,n);await f.default.mkdir(u,{recursive:!0});let ze=await f.default.readdir(g);for(let N of ze)await f.default.rename(p.default.join(g,N),p.default.join(u,N));await f.default.rm(m,{recursive:!0,force:!0})}}catch(l){console.error(b(n,i,l)),process.exit(1)}}var v=a(require("path")),P=a(require("fs/promises"));var Ke={dev:process.env.EXTENSION_ENV==="development"?"node node_modules/extension dev":"extension dev",start:process.env.EXTENSION_ENV==="development"?"node node_modules/extension start":"extension start",build:process.env.EXTENSION_ENV==="development"?"node node_modules/extension build":"extension build"};async function Te(e,n,o){let r=ye(process.cwd()),i=he(o)?v.default.join(e,"package.json"):v.default.join(r,"package.json"),s=await P.default.readFile(i),c=JSON.parse(s.toString());c.scripts=c.scripts||{},c.dependencies=c.dependencies||{},c.devDependencies={...c.devDependencies||{},extension:process.env.EXTENSION_ENV==="development"?"*":"latest"};let l={...c,name:v.default.basename(e),private:!0,scripts:{...c.scripts,...Ke},dependencies:c.dependencies,devDependencies:c.devDependencies,author:{name:"Your Name",email:"your@email.com",url:"https://yourwebsite.com"}};try{console.log(ae()),await P.default.writeFile(v.default.join(e,"package.json"),JSON.stringify(l,null,2))}catch(m){console.error(ce(n,m)),process.exit(1)}}var Se=a(require("path")),Pe=require("cross-spawn"),Ie=a(require("fs"));var Ce=a(require("path")),I=require("cross-spawn");async function _e(e){let n=Ce.default.join(__dirname,"../../cli"),o=await y(),r=["link"];await new Promise((i,s)=>{(0,I.spawn)(o,r,{cwd:n}).on("close",()=>{(0,I.spawn)(o,[...r,"extension"],{stdio:"inherit",cwd:e}).on("close",m=>{m===0?(console.log(oe()),i()):s(new Error(se(o,r)))})})}),console.log("Symlink creation completed.")}function Qe(){return["install","--silent"]}async function Je(e,n){let o=Se.default.join(e,"node_modules"),r=await y(),i=Qe();console.log(ne()),process.env.EXTENSION_ENV==="development"&&await _e(e);try{let s=process.cwd();process.chdir(e),await Ie.default.promises.mkdir(o,{recursive:!0});let c=process.env.EXTENSION_ENV==="development"?"inherit":"ignore",l=(0,Pe.spawn)(r,i,{stdio:c});await new Promise((m,g)=>{l.on("close",u=>{process.chdir(s),u!==0?g(new Error(te(r,i,u))):m()}),l.on("error",u=>{process.chdir(s),console.error(ie(n,u)),g(u)})})}catch(s){console.error(re(n,s)),process.exit(1)}}var D=a(require("path")),F=a(require("fs/promises"));async function Me(e,n){let o=await F.default.readFile(D.default.join(__dirname,"template","README.md"),"utf-8"),r=await y(),i=require(D.default.join(e,"manifest.json")),s=o.replaceAll("[projectName]",n).replaceAll("[templateDescription]",i.description).replaceAll("[runCommand]",r);try{console.log(pe()),await F.default.mkdir(e,{recursive:!0}),await F.default.writeFile(D.default.join(e,"README.md"),s)}catch(c){console.error(de(n,c)),process.exit(1)}}var T=a(require("path")),J=a(require("fs/promises"));async function Re(e,n){let o=T.default.join(e,"manifest.json"),r=await J.default.readFile(o),s={...JSON.parse(r.toString()),name:T.default.basename(e),author:"Your Name"};try{console.log(le()),await J.default.writeFile(T.default.join(e,"manifest.json"),JSON.stringify(s,null,2))}catch(c){console.error(me(n,c)),process.exit(1)}}var M=a(require("path")),R=a(require("fs/promises"));async function Ne(e,n){let o=M.default.join(e,"extension-env.d.ts"),r=process.env.EXTENSION_ENV==="development"?M.default.resolve(process.cwd(),"programs/cli/types"):"extension/dist/types",i=`// Required Extension.js types for TypeScript projects.
|
|
29
29
|
// This file is auto-generated and should not be excluded.
|
|
30
30
|
// If you need additional types, consider creating a new *.d.ts file and
|
|
31
31
|
// referencing it in the "include" array of your tsconfig.json file.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# test-template-action
|
|
2
|
+
|
|
3
|
+
> An Extension.js example.
|
|
4
|
+
|
|
5
|
+
## Available Scripts
|
|
6
|
+
|
|
7
|
+
In the project directory, you can run the following scripts:
|
|
8
|
+
|
|
9
|
+
### pnpm dev
|
|
10
|
+
|
|
11
|
+
**Development Mode**: This command runs your extension in development mode. It will launch a new browser instance with your extension loaded. The page will automatically reload whenever you make changes to your code, allowing for a smooth development experience.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### pnpm start
|
|
18
|
+
|
|
19
|
+
**Production Preview**: This command runs your extension in production mode. It will launch a new browser instance with your extension loaded, simulating the environment and behavior of your extension as it will appear once published.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm start
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### pnpm build
|
|
26
|
+
|
|
27
|
+
**Build for Production**: This command builds your extension for production. It optimizes and bundles your extension, preparing it for deployment to the target browser's store.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Learn More
|
|
34
|
+
|
|
35
|
+
To learn more about creating cross-browser extensions with Extension.js, visit the [official documentation](https://extension.js.org).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Action Extension</title>
|
|
7
|
+
<link
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
href="https://unpkg.com/sakura.css/css/sakura.css"
|
|
10
|
+
media="screen"
|
|
11
|
+
/>
|
|
12
|
+
<link
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
href="https://unpkg.com/sakura.css/css/sakura-dark.css"
|
|
15
|
+
media="screen and (prefers-color-scheme: dark)"
|
|
16
|
+
/>
|
|
17
|
+
<link rel="stylesheet" href="./styles.css" media="screen" />
|
|
18
|
+
</head>
|
|
19
|
+
<body class="popup">
|
|
20
|
+
<header>
|
|
21
|
+
<h1>
|
|
22
|
+
<img
|
|
23
|
+
class="action"
|
|
24
|
+
src="../images/extension_128.png"
|
|
25
|
+
alt="The Extension logo"
|
|
26
|
+
width="72px"
|
|
27
|
+
/>
|
|
28
|
+
<br />
|
|
29
|
+
Welcome to your Action Extension
|
|
30
|
+
</h1>
|
|
31
|
+
<p>
|
|
32
|
+
Learn more about creating cross-browser extensions at
|
|
33
|
+
<a href="https://extension.js.org" target="_blank"
|
|
34
|
+
>https://extension.js.org</a
|
|
35
|
+
>.
|
|
36
|
+
</p>
|
|
37
|
+
</header>
|
|
38
|
+
</body>
|
|
39
|
+
<script src="./scripts.js"></script>
|
|
40
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
body {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 300px;
|
|
6
|
+
padding: 2em;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
h1 {
|
|
10
|
+
font-size: 2.7em;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.action {
|
|
14
|
+
filter: grayscale(1);
|
|
15
|
+
transition:
|
|
16
|
+
filter 2s,
|
|
17
|
+
border-color 2s;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.action:hover {
|
|
21
|
+
filter: grayscale(0);
|
|
22
|
+
border-color: aquamarine;
|
|
23
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"name": "test-template-action",
|
|
5
|
+
"description": "An Extension.js example.",
|
|
6
|
+
"icons": {
|
|
7
|
+
"16": "images/extension_16.png",
|
|
8
|
+
"48": "images/extension_48.png",
|
|
9
|
+
"128": "images/extension_128.png"
|
|
10
|
+
},
|
|
11
|
+
"action": {
|
|
12
|
+
"default_popup": "action/index.html",
|
|
13
|
+
"default_title": "Action",
|
|
14
|
+
"default_icon": {
|
|
15
|
+
"16": "images/extension_16.png",
|
|
16
|
+
"48": "images/extension_48.png",
|
|
17
|
+
"128": "images/extension_128.png"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"author": "Your Name"
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "test-template-action",
|
|
4
|
+
"description": "An Extension.js example.",
|
|
5
|
+
"version": "0.0.1",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Your Name",
|
|
8
|
+
"email": "your@email.com",
|
|
9
|
+
"url": "https://yourwebsite.com"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "extension dev",
|
|
14
|
+
"start": "extension start",
|
|
15
|
+
"build": "extension build"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"extension": "latest"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
EXTENSION_OPENAI_API_KEY='My API Key'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# test-template-action-chatgpt
|
|
2
|
+
|
|
3
|
+
> An Extension.js example.
|
|
4
|
+
|
|
5
|
+
## Available Scripts
|
|
6
|
+
|
|
7
|
+
In the project directory, you can run the following scripts:
|
|
8
|
+
|
|
9
|
+
### pnpm dev
|
|
10
|
+
|
|
11
|
+
**Development Mode**: This command runs your extension in development mode. It will launch a new browser instance with your extension loaded. The page will automatically reload whenever you make changes to your code, allowing for a smooth development experience.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### pnpm start
|
|
18
|
+
|
|
19
|
+
**Production Preview**: This command runs your extension in production mode. It will launch a new browser instance with your extension loaded, simulating the environment and behavior of your extension as it will appear once published.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm start
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### pnpm build
|
|
26
|
+
|
|
27
|
+
**Build for Production**: This command builds your extension for production. It optimizes and bundles your extension, preparing it for deployment to the target browser's store.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Learn More
|
|
34
|
+
|
|
35
|
+
To learn more about creating cross-browser extensions with Extension.js, visit the [official documentation](https://extension.js.org).
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {useState, type FormEvent} from 'react'
|
|
2
|
+
import OpenAI from 'openai'
|
|
3
|
+
import chatgptLogo from '../images/chatgpt.png'
|
|
4
|
+
import extensionJsLogo from '../images/extension_128.png'
|
|
5
|
+
|
|
6
|
+
const openai = new OpenAI({
|
|
7
|
+
apiKey: process.env.EXTENSION_OPENAI_API_KEY!,
|
|
8
|
+
dangerouslyAllowBrowser: true
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
interface Message {
|
|
12
|
+
content: string
|
|
13
|
+
role: 'user' | 'assistant'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function ActionApp() {
|
|
17
|
+
const [messages, setMessages] = useState<Message[]>([
|
|
18
|
+
{
|
|
19
|
+
content:
|
|
20
|
+
'Hello there! This is your ChatGPT extension sample, ' +
|
|
21
|
+
'built with React, Tailwind.css, and DaisyUI. ' +
|
|
22
|
+
'For it to work, create a .env file with your EXTENSION_OPENAI_API_KEY. ' +
|
|
23
|
+
"You can get an API key from OpenAI's website",
|
|
24
|
+
role: 'assistant'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
content: 'https://platform.openai.com/api-keys',
|
|
28
|
+
role: 'assistant'
|
|
29
|
+
}
|
|
30
|
+
])
|
|
31
|
+
|
|
32
|
+
const [isTyping, setIsTyping] = useState(false)
|
|
33
|
+
|
|
34
|
+
const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {
|
|
35
|
+
e.preventDefault()
|
|
36
|
+
|
|
37
|
+
const form = e.target as HTMLFormElement
|
|
38
|
+
const input = form[0] as HTMLInputElement
|
|
39
|
+
|
|
40
|
+
const newMessage: Message = {
|
|
41
|
+
content: input.value,
|
|
42
|
+
role: 'user'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const newMessages = [...messages, newMessage]
|
|
46
|
+
|
|
47
|
+
setMessages(newMessages)
|
|
48
|
+
setIsTyping(true)
|
|
49
|
+
form.reset()
|
|
50
|
+
|
|
51
|
+
const completion = await openai.chat.completions.create({
|
|
52
|
+
model: 'gpt-3.5-turbo',
|
|
53
|
+
messages: newMessages
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
setMessages([...newMessages, completion.choices[0].message as Message])
|
|
57
|
+
setIsTyping(false)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<section className="container mx-auto p-5 fixed inset-0">
|
|
62
|
+
<div className="w-full h-full flex flex-col">
|
|
63
|
+
<div className="flex-grow overflow-auto">
|
|
64
|
+
{messages.length &&
|
|
65
|
+
messages.map((msg, i) => (
|
|
66
|
+
<div
|
|
67
|
+
className={`chat ${
|
|
68
|
+
msg.role === 'assistant' ? 'chat-start' : 'chat-end'
|
|
69
|
+
}`}
|
|
70
|
+
key={'chatKey' + i}
|
|
71
|
+
>
|
|
72
|
+
<div className="chat-image avatar">
|
|
73
|
+
<div className="w-10 rounded-full">
|
|
74
|
+
<img
|
|
75
|
+
src={
|
|
76
|
+
msg.role === 'assistant' ? chatgptLogo : extensionJsLogo
|
|
77
|
+
}
|
|
78
|
+
alt="avatar"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div className="chat-bubble">{msg.content}</div>
|
|
83
|
+
</div>
|
|
84
|
+
))}
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<form className="form-control items-center" onSubmit={handleSubmit}>
|
|
88
|
+
<div className="input-group max-w-full w-[800px] relative flex items-center">
|
|
89
|
+
{isTyping && (
|
|
90
|
+
<small className="absolute -top-5 left-0.5 animate-pulse">
|
|
91
|
+
ChatGPT Extension is typing...
|
|
92
|
+
</small>
|
|
93
|
+
)}
|
|
94
|
+
|
|
95
|
+
<input
|
|
96
|
+
type="text"
|
|
97
|
+
placeholder="Ask ChatGPT a question."
|
|
98
|
+
className="input input-bordered flex-grow mr-2.5"
|
|
99
|
+
required
|
|
100
|
+
/>
|
|
101
|
+
<button className="btn btn-square" type="submit">
|
|
102
|
+
<svg
|
|
103
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
104
|
+
className="h-6 w-6"
|
|
105
|
+
fill="currentColor"
|
|
106
|
+
viewBox="0 0 16 16"
|
|
107
|
+
>
|
|
108
|
+
<path d="M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z" />
|
|
109
|
+
</svg>
|
|
110
|
+
</button>
|
|
111
|
+
</div>
|
|
112
|
+
</form>
|
|
113
|
+
</div>
|
|
114
|
+
</section>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export default ActionApp
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>ChatGPT Template</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<noscript>You need to enable JavaScript to run this extension.</noscript>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
</body>
|
|
12
|
+
<script src="./scripts.tsx"></script>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import ReactDOM from 'react-dom/client'
|
|
3
|
+
import ActionApp from './ActionApp'
|
|
4
|
+
import './styles.css'
|
|
5
|
+
|
|
6
|
+
const root = ReactDOM.createRoot(document.getElementById('root')!)
|
|
7
|
+
|
|
8
|
+
root.render(
|
|
9
|
+
<React.StrictMode>
|
|
10
|
+
<ActionApp />
|
|
11
|
+
</React.StrictMode>
|
|
12
|
+
)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"name": "test-template-action-chatgpt",
|
|
5
|
+
"description": "An Extension.js example.",
|
|
6
|
+
"icons": {
|
|
7
|
+
"16": "images/extension_16.png",
|
|
8
|
+
"48": "images/extension_48.png",
|
|
9
|
+
"128": "images/extension_128.png"
|
|
10
|
+
},
|
|
11
|
+
"action": {
|
|
12
|
+
"default_icon": {
|
|
13
|
+
"16": "images/extension_16.png",
|
|
14
|
+
"48": "images/extension_48.png",
|
|
15
|
+
"128": "images/extension_128.png"
|
|
16
|
+
},
|
|
17
|
+
"default_title": "ChatGPT",
|
|
18
|
+
"default_popup": "action/index.html"
|
|
19
|
+
},
|
|
20
|
+
"author": "Your Name"
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "test-template-action-chatgpt",
|
|
4
|
+
"description": "An Extension.js example.",
|
|
5
|
+
"version": "0.0.1",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Your Name",
|
|
8
|
+
"email": "your@email.com",
|
|
9
|
+
"url": "https://yourwebsite.com"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"daisyui": "^4.12.10",
|
|
14
|
+
"openai": "^4.57.2",
|
|
15
|
+
"react": "^18.1.0",
|
|
16
|
+
"react-dom": "^18.1.0",
|
|
17
|
+
"tailwindcss": "^3.4.1"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/react": "^18.3.5",
|
|
21
|
+
"@types/react-dom": "^18.3.0",
|
|
22
|
+
"typescript": "5.3.3",
|
|
23
|
+
"extension": "latest"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "extension dev",
|
|
27
|
+
"start": "extension start",
|
|
28
|
+
"build": "extension build"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"forceConsistentCasingInFileNames": true,
|
|
7
|
+
"isolatedModules": true,
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"strict": true,
|
|
15
|
+
"target": "esnext",
|
|
16
|
+
"verbatimModuleSyntax": true,
|
|
17
|
+
"useDefineForClassFields": true,
|
|
18
|
+
"skipLibCheck": true
|
|
19
|
+
},
|
|
20
|
+
"include": ["./"],
|
|
21
|
+
"exclude": ["node_modules", "dist"]
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# test-template-config-stylelint
|
|
2
|
+
|
|
3
|
+
> An Extension.js example.
|
|
4
|
+
|
|
5
|
+
## Available Scripts
|
|
6
|
+
|
|
7
|
+
In the project directory, you can run the following scripts:
|
|
8
|
+
|
|
9
|
+
### pnpm dev
|
|
10
|
+
|
|
11
|
+
**Development Mode**: This command runs your extension in development mode. It will launch a new browser instance with your extension loaded. The page will automatically reload whenever you make changes to your code, allowing for a smooth development experience.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### pnpm start
|
|
18
|
+
|
|
19
|
+
**Production Preview**: This command runs your extension in production mode. It will launch a new browser instance with your extension loaded, simulating the environment and behavior of your extension as it will appear once published.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm start
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### pnpm build
|
|
26
|
+
|
|
27
|
+
**Build for Production**: This command builds your extension for production. It optimizes and bundles your extension, preparing it for deployment to the target browser's store.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Learn More
|
|
34
|
+
|
|
35
|
+
To learn more about creating cross-browser extensions with Extension.js, visit the [official documentation](https://extension.js.org).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="2500" height="2393" viewBox="0 0 256 245" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid"><path d="M129.74 243.648c28-100.109 27.188-100.563 47.425-171.942l4.864 2.816c2.65 1.516 4.813.268 4.813-2.778V37.696C192.218 18.893 196.416 4.352 197.658 0h21.92L256 33.728 232.077 54.4l18.093 19.565-119.226 169.683c-.576.96-1.389.742-1.203 0zm13.025-215.782c1.088 0 1.958.595 1.958 1.344v17.44c0 .73-.877 1.324-1.958 1.324h-29.44c-1.088 0-1.965-.595-1.965-1.33V29.196c0-.736.877-1.344 1.958-1.344h29.44l.007.013zM179.117 8.55L146.72 27.251c.371.576.602 1.235.602 1.952v17.453c0 .896-.359 1.715-.935 2.368l32.723 18.893c2.228 1.293 4.058.237 4.058-2.336V10.893c0-2.58-1.818-3.629-4.051-2.343zm-70.362 38.106v-17.46c0-.716.23-1.375.602-1.945L76.96 8.538c-2.227-1.28-4.058-.23-4.058 2.342v54.688c0 2.573 1.83 3.629 4.064 2.336l32.717-18.893c-.576-.659-.921-1.472-.921-2.368l-.007.013zm16.301 196.992h1.203C98.266 143.539 99.072 143.085 78.835 71.706l-4.864 2.816c-2.643 1.516-4.813.268-4.813-2.778V37.696C63.782 18.899 59.584 4.352 58.342 0H36.43L0 33.728 23.917 54.4 5.824 73.971l119.232 169.677zM127.11 84.41a8.845 8.845 0 1 0 0-17.69 8.845 8.845 0 0 0 0 17.69zm0 52.576a8.845 8.845 0 1 0 0-17.69 8.845 8.845 0 0 0 0 17.69zm0 52.588a8.845 8.845 0 1 0 0-17.69 8.845 8.845 0 0 0 0 17.69z"/></svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"name": "test-template-config-stylelint",
|
|
5
|
+
"description": "An Extension.js example.",
|
|
6
|
+
"icons": {
|
|
7
|
+
"16": "images/extension_16.png",
|
|
8
|
+
"48": "images/extension_48.png",
|
|
9
|
+
"128": "images/extension_128.png"
|
|
10
|
+
},
|
|
11
|
+
"chrome_url_overrides": {
|
|
12
|
+
"newtab": "newtab/index.html"
|
|
13
|
+
},
|
|
14
|
+
"author": "Your Name"
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Stylelint Extension</title>
|
|
7
|
+
<link
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
href="https://unpkg.com/sakura.css/css/sakura.css"
|
|
10
|
+
media="screen"
|
|
11
|
+
/>
|
|
12
|
+
<link
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
href="https://unpkg.com/sakura.css/css/sakura-dark.css"
|
|
15
|
+
media="screen and (prefers-color-scheme: dark)"
|
|
16
|
+
/>
|
|
17
|
+
<link rel="stylesheet" href="./styles.css" media="screen" />
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<header>
|
|
21
|
+
<h1>
|
|
22
|
+
<img
|
|
23
|
+
class="stylelint"
|
|
24
|
+
src="../images/stylelint.svg"
|
|
25
|
+
alt="The Stylelint logo"
|
|
26
|
+
width="120px"
|
|
27
|
+
/>
|
|
28
|
+
<br />
|
|
29
|
+
Welcome to your Stylelint Extension
|
|
30
|
+
</h1>
|
|
31
|
+
<p>
|
|
32
|
+
Learn more about creating cross-browser extensions at
|
|
33
|
+
<a href="https://extension.js.org" target="_blank"
|
|
34
|
+
>https://extension.js.org</a
|
|
35
|
+
>.
|
|
36
|
+
</p>
|
|
37
|
+
</header>
|
|
38
|
+
</body>
|
|
39
|
+
<script src="./scripts.js"></script>
|
|
40
|
+
</html>
|