ソースを参照

update single-file-core

Gildas 3 年 前
コミット
dcff4f493a

+ 3 - 3
cli/back-ends/common/scripts.js

@@ -35,9 +35,9 @@ const INDEX_SCRIPTS = [
 ];
 
 const WEB_SCRIPTS = [
-	"/lib/web/hooks/hooks-web.js",
-	"/lib/web/hooks/hooks-frames-web.js",
-	"/lib/web/infobar-web.js"
+	"/lib/single-file-hooks.js",
+	"/lib/single-file-hooks-frames.js",
+	"/lib/single-file-infobar.js"
 ];
 
 exports.get = async options => {

+ 1 - 1
lib/infobar.js

@@ -1 +1 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).infobar={})}(this,(function(e){"use strict";const t="/lib/web/infobar-web.js",n=globalThis.browser;e.includeScript=async function(e){let i,o;for(n&&n.runtime&&n.runtime.getURL?i=await(await fetch(n.runtime.getURL(t))).text():singlefile.getFileContent&&(i=singlefile.getFileContent(t));o!=i;)o=i,i=i.replace(/\/\*(.|\n)*?\*\//,"");i=i.replace(/\t+/g," ").replace(/\nthis\.[^(]*/gi,"\n").replace(/\n+/g,""),e.content+="<script>document.currentScript.remove();"+i+"<\/script>"},Object.defineProperty(e,"__esModule",{value:!0})}));
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).infobar={})}(this,(function(e){"use strict";const t="/lib/single-file-infobar.js",n=globalThis.browser;e.includeScript=async function(e){let i,o;for(n&&n.runtime&&n.runtime.getURL?i=await(await fetch(n.runtime.getURL(t))).text():singlefile.getFileContent&&(i=singlefile.getFileContent(t));o!=i;)o=i,i=i.replace(/\/\*(.|\n)*?\*\//,"");i=i.replace(/\t+/g," ").replace(/\nthis\.[^(]*/gi,"\n").replace(/\n+/g,""),e.content+="<script>document.currentScript.remove();"+i+"<\/script>"},Object.defineProperty(e,"__esModule",{value:!0})}));

ファイルの差分が大きいため隠しています
+ 0 - 0
lib/single-file-bootstrap.js


+ 0 - 0
lib/web/editor/editor-helper-web.js → lib/single-file-editor-helper.js


+ 0 - 0
lib/web/editor/editor-init-web.js → lib/single-file-editor-init.js


+ 1 - 1
lib/web/editor/editor-web.js → lib/single-file-editor.js

@@ -1005,7 +1005,7 @@ table {
 			if (initScriptContentMatch && initScriptContentMatch[0]) {
 				initScriptContent = initScriptContentMatch[0];
 			}
-			content = content.replace(/<script data-template-shadow-root.*<\/script>/g, "<script data-template-shadow-root src=/lib/web/editor/editor-init-web.js></script>");
+			content = content.replace(/<script data-template-shadow-root.*<\/script>/g, "<script data-template-shadow-root src=/lib/single-file-editor-init.js></script>");
 			const contentDocument = (new DOMParser()).parseFromString(content, "text/html");
 			if (detectSavedPage(contentDocument)) {
 				if (contentDocument.doctype) {

ファイルの差分が大きいため隠しています
+ 0 - 0
lib/single-file-frames.js


+ 0 - 0
lib/web/hooks/hooks-frames-web.js → lib/single-file-hooks-frames.js


+ 0 - 0
lib/web/hooks/hooks-web.js → lib/single-file-hooks.js


+ 0 - 0
lib/web/infobar-web.js → lib/single-file-infobar.js


ファイルの差分が大きいため隠しています
+ 0 - 0
lib/single-file.js


+ 7 - 7
manifest.json

@@ -33,7 +33,7 @@
 				"lib/chrome-browser-polyfill.js",
 				"lib/single-file-bootstrap.js",
 				"lib/extension-bootstrap.js",
-				"lib/web/infobar-web.js"
+				"lib/single-file-infobar.js"
 			]
 		}
 	],
@@ -78,12 +78,12 @@
 		}
 	},
 	"web_accessible_resources": [
-		"lib/web/hooks/hooks-web.js",
-		"lib/web/hooks/hooks-frames-web.js",
-		"lib/web/infobar-web.js",
-		"lib/web/editor/editor-init-web.js",
-		"lib/web/editor/editor-web.js",
-		"lib/web/editor/editor-helper-web.js",
+		"lib/single-file-hooks.js",
+		"lib/single-file-hooks-frames.js",
+		"lib/single-file-infobar.js",
+		"lib/single-file-editor-init.js",
+		"lib/single-file-editor.js",
+		"lib/single-file-editor-helper.js",
 		"src/extension/lib/readability/Readability.js",
 		"src/extension/lib/readability/Readability-readerable.js",
 		"src/extension/ui/pages/editor-note-web.css",

+ 3 - 3
package-lock.json

@@ -1098,9 +1098,9 @@
 			"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E="
 		},
 		"single-file-core": {
-			"version": "1.0.2",
-			"resolved": "https://registry.npmjs.org/single-file-core/-/single-file-core-1.0.2.tgz",
-			"integrity": "sha512-B4zhPaSfL0C6Lk2LnJfI2TugCsnZ9DPSeM1Z+Z4cwT0J9R038dicRBkHhxesNwr4liP0+mqoz9cQvPXs+P7rzg=="
+			"version": "1.0.3",
+			"resolved": "https://registry.npmjs.org/single-file-core/-/single-file-core-1.0.3.tgz",
+			"integrity": "sha512-JDcMKT8yPK3f/xAkWBr6WTosWg1hs3y0GJ23uOtchgI/FkrLKuILWlpo0iftempQZis5S6rolGpvmzX7pYxIuw=="
 		},
 		"source-map": {
 			"version": "0.6.1",

+ 1 - 1
package.json

@@ -14,7 +14,7 @@
 		"jsdom": "19.0.0",
 		"puppeteer-core": "13.5.2",
 		"selenium-webdriver": "4.1.1",
-		"single-file-core": "1.0.2",
+		"single-file-core": "1.0.3",
 		"strong-data-uri": "1.0.6",
 		"yargs": "17.4.0"
 	},

+ 7 - 9
rollup.config.dev.js

@@ -1,8 +1,6 @@
 import resolve from "@rollup/plugin-node-resolve";
 
-const PLUGINS = [
-	resolve({ moduleDirectories: [".."] })
-];
+const PLUGINS = [resolve({ moduleDirectories: [".."] })];
 const EXTERNAL = ["single-file-core"];
 
 export default [{
@@ -75,7 +73,7 @@ export default [{
 }, {
 	input: ["src/single-file/single-file-hooks-web.js"],
 	output: [{
-		file: "lib/web/hooks/hooks-web.js",
+		file: "lib/single-file-hooks.js",
 		format: "iife",
 		plugins: []
 	}],
@@ -84,7 +82,7 @@ export default [{
 }, {
 	input: ["src/single-file/single-file-hooks-frames-web.js"],
 	output: [{
-		file: "lib/web/hooks/hooks-frames-web.js",
+		file: "lib/single-file-hooks-frames.js",
 		format: "iife",
 		plugins: []
 	}],
@@ -93,28 +91,28 @@ export default [{
 }, {
 	input: ["src/common/ui/content/content-infobar-web.js"],
 	output: [{
-		file: "lib/web/infobar-web.js",
+		file: "lib/single-file-infobar.js",
 		format: "iife",
 		plugins: []
 	}]
 }, {
 	input: ["src/extension/ui/content/content-ui-editor-init-web.js"],
 	output: [{
-		file: "lib/web/editor/editor-init-web.js",
+		file: "lib/single-file-editor-init.js",
 		format: "iife",
 		plugins: []
 	}]
 }, {
 	input: ["src/extension/ui/content/content-ui-editor-web.js"],
 	output: [{
-		file: "lib/web/editor/editor-web.js",
+		file: "lib/single-file-editor.js",
 		format: "iife",
 		plugins: []
 	}]
 }, {
 	input: ["src/extension/ui/content/content-ui-editor-helper-web"],
 	output: [{
-		file: "lib/web/editor/editor-helper-web.js",
+		file: "lib/single-file-editor-helper.js",
 		format: "umd",
 		name: "singlefile",
 		plugins: []

+ 7 - 9
rollup.config.js

@@ -1,9 +1,7 @@
 import { terser } from "rollup-plugin-terser";
 import resolve from "@rollup/plugin-node-resolve";
 
-const PLUGINS = [
-	resolve({ moduleDirectories: ["node_modules"] })
-];
+const PLUGINS = [resolve({ moduleDirectories: ["node_modules"] })];
 const EXTERNAL = ["single-file-core"];
 
 export default [{
@@ -76,7 +74,7 @@ export default [{
 }, {
 	input: ["src/single-file/single-file-hooks-web.js"],
 	output: [{
-		file: "lib/web/hooks/hooks-web.js",
+		file: "lib/single-file-hooks.js",
 		format: "iife",
 		plugins: [terser()]
 	}],
@@ -85,7 +83,7 @@ export default [{
 }, {
 	input: ["src/single-file/single-file-hooks-frames-web.js"],
 	output: [{
-		file: "lib/web/hooks/hooks-frames-web.js",
+		file: "lib/single-file-hooks-frames.js",
 		format: "iife",
 		plugins: [terser()]
 	}],
@@ -94,28 +92,28 @@ export default [{
 }, {
 	input: ["src/common/ui/content/content-infobar-web.js"],
 	output: [{
-		file: "lib/web/infobar-web.js",
+		file: "lib/single-file-infobar.js",
 		format: "iife",
 		plugins: [terser()]
 	}]
 }, {
 	input: ["src/extension/ui/content/content-ui-editor-init-web.js"],
 	output: [{
-		file: "lib/web/editor/editor-init-web.js",
+		file: "lib/single-file-editor-init.js",
 		format: "iife",
 		plugins: [terser()]
 	}]
 }, {
 	input: ["src/extension/ui/content/content-ui-editor-web.js"],
 	output: [{
-		file: "lib/web/editor/editor-web.js",
+		file: "lib/single-file-editor.js",
 		format: "iife",
 		plugins: []
 	}]
 }, {
 	input: ["src/extension/ui/content/content-ui-editor-helper-web"],
 	output: [{
-		file: "lib/web/editor/editor-helper-web.js",
+		file: "lib/single-file-editor-helper.js",
 		format: "umd",
 		name: "singlefile",
 		plugins: [terser()]

+ 1 - 1
src/common/ui/content/content-infobar.js

@@ -23,7 +23,7 @@
 
 /* global globalThis, singlefile, fetch */
 
-const SCRIPT_PATH = "/lib/web/infobar-web.js";
+const SCRIPT_PATH = "/lib/single-file-infobar.js";
 
 const browser = globalThis.browser;
 

+ 1 - 1
src/extension/lib/woleet/woleet.js

@@ -22,7 +22,7 @@
  */
 /* global fetch */
 const urlService = "https://api.woleet.io/v1/anchor";
-const apiKey = "";
+const apiKey = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhYzZmZTMzMi0wODNjLTRjZmMtYmYxNC0xNWU5MTJmMWY4OWIiLCJpYXQiOjE1NzYxNzQzNDV9.n31j9ctJj7R1Vjwyc5yd1d6Cmg0NDnpwSaLWsqtZJQA";
 export {
 	anchor
 };

+ 1 - 1
src/extension/ui/content/content-ui-editor-web.js

@@ -1002,7 +1002,7 @@ table {
 		if (initScriptContentMatch && initScriptContentMatch[0]) {
 			initScriptContent = initScriptContentMatch[0];
 		}
-		content = content.replace(/<script data-template-shadow-root.*<\/script>/g, "<script data-template-shadow-root src=/lib/web/editor/editor-init-web.js></script>");
+		content = content.replace(/<script data-template-shadow-root.*<\/script>/g, "<script data-template-shadow-root src=/lib/single-file-editor-init.js></script>");
 		const contentDocument = (new DOMParser()).parseFromString(content, "text/html");
 		if (detectSavedPage(contentDocument)) {
 			if (contentDocument.doctype) {

+ 1 - 1
src/extension/ui/pages/editor.html

@@ -68,7 +68,7 @@
 		</div>
 	</div>
 	<iframe class="editor"
-		srcdoc="&lt;!DOCTYPE html&gt;&lt;body&gt;&lt;script src=/lib/web/editor/editor-helper-web.js&gt;&lt;/script&gt;&lt;script src=/lib/web/editor/editor-web.js&gt;&lt;/script&gt;&lt;script src=/src/extension/lib/readability/Readability.js&gt;&lt;/script&gt;&lt;/script&gt;&lt;script src=/src/extension/lib/readability/Readability-readerable.js&gt;&lt;/script&gt;&lt;/body&gt;"
+		srcdoc="&lt;!DOCTYPE html&gt;&lt;body&gt;&lt;script src=/lib/single-file-editor-helper.js&gt;&lt;/script&gt;&lt;script src=/lib/single-file-editor.js&gt;&lt;/script&gt;&lt;script src=/src/extension/lib/readability/Readability.js&gt;&lt;/script&gt;&lt;/script&gt;&lt;script src=/src/extension/lib/readability/Readability-readerable.js&gt;&lt;/script&gt;&lt;/body&gt;"
 		sandbox="allow-scripts allow-modals"></iframe>
 	<script src="/lib/chrome-browser-polyfill.js"></script>
 	<script src="/lib/single-file.js"></script>

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません