Skip to content

Commit

Permalink
Removed leftover console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed Aug 7, 2023
1 parent 8e8b027 commit 2b1cb1b
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 110 deletions.
171 changes: 85 additions & 86 deletions package/package.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,85 @@
{
"name": "prism-code-editor",
"version": "0.0.1",
"type": "module",
"description": "Lightweight, extensible code editor for the web using Prism",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": "./dist/index.js",
"./guides": "./dist/extensions/guides.js",
"./web-component": "./dist/webComponent.js",
"./copy-button": "./dist/extensions/copyButton/index.js",
"./copy-button.css": "./dist/copy.css",
"./scrollbar.css": "./dist/scrollbar.css",
"./setups": "./dist/setups.js",
"./layout.css": "./dist/layout.css",
"./themes/*.css": "./dist/themes/*.css",
"./themes": "./dist/themes/index.js",
"./languages": "./dist/languages/index.js",
"./languages/clike": "./dist/languages/clike.js",
"./languages/css": "./dist/languages/css.js",
"./languages/html": "./dist/languages/html.js",
"./languages/jsx": "./dist/languages/jsx.js",
"./languages/python": "./dist/languages/python.js",
"./languages/xml": "./dist/languages/xml.js",
"./match-brackets": "./dist/extensions/matchBrackets.js",
"./commands": "./dist/extensions/commands.js",
"./cursor": "./dist/extensions/cursor.js",
"./prism-core": "./dist/prismCore.js",
"./prism-markdown": "./dist/prismMarkdown.js",
"./search": "./dist/extensions/search/index.js",
"./search/api": "./dist/extensions/search/api.js",
"./search.css": "./dist/search.css"
},
"typesVersions": {
"*": {
"*": [
"./dist/*"
]
}
},
"files": [
"dist/*"
],
"scripts": {
"dev": "vite",
"build": "tsc && vite build && node scripts/build.mjs",
"preview": "vite preview",
"prepublish": "tsc && vite build && node scripts/build.mjs"
},
"devDependencies": {
"@types/node": "^20.3.1",
"prismjs": "^1.29.0",
"typescript": "^5.0.2",
"vite": "^4.3.9",
"vite-plugin-dts": "^2.3.0"
},
"dependencies": {
"@types/prismjs": "^1.26.0"
},
"keywords": [
"editor",
"code editor",
"textarea",
"small",
"highlight",
"prismjs"
],
"author": "FlameCaster",
"repository": {
"type": "git",
"url": "git+https://github.com/FIameCaster/prism-code-editor.git"
},
"license": "MIT",
"sideEffects": [
"*.css",
"./dist/languages/*",
"./dist/prism-core.js",
"./dist/prism-markdown.js"
],
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
{
"name": "prism-code-editor",
"version": "0.0.2",
"type": "module",
"description": "Lightweight, extensible code editor for the web using Prism",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": "./dist/index.js",
"./guides": "./dist/extensions/guides.js",
"./web-component": "./dist/webComponent.js",
"./copy-button": "./dist/extensions/copyButton/index.js",
"./copy-button.css": "./dist/copy.css",
"./scrollbar.css": "./dist/scrollbar.css",
"./setups": "./dist/setups.js",
"./layout.css": "./dist/layout.css",
"./themes/*.css": "./dist/themes/*.css",
"./themes": "./dist/themes/index.js",
"./languages": "./dist/languages/index.js",
"./languages/clike": "./dist/languages/clike.js",
"./languages/css": "./dist/languages/css.js",
"./languages/html": "./dist/languages/html.js",
"./languages/jsx": "./dist/languages/jsx.js",
"./languages/python": "./dist/languages/python.js",
"./languages/xml": "./dist/languages/xml.js",
"./match-brackets": "./dist/extensions/matchBrackets.js",
"./commands": "./dist/extensions/commands.js",
"./cursor": "./dist/extensions/cursor.js",
"./prism-core": "./dist/prismCore.js",
"./prism-markdown": "./dist/prismMarkdown.js",
"./search": "./dist/extensions/search/index.js",
"./search/api": "./dist/extensions/search/api.js",
"./search.css": "./dist/search.css"
},
"typesVersions": {
"*": {
"*": [
"./dist/*"
]
}
},
"files": [
"dist/*"
],
"scripts": {
"dev": "vite",
"build": "tsc && vite build && node scripts/build.mjs",
"preview": "vite preview",
"prepublish": "tsc && vite build && node scripts/build.mjs"
},
"devDependencies": {
"prismjs": "^1.29.0",
"typescript": "^5.0.2",
"vite": "^4.3.9",
"vite-plugin-dts": "^2.3.0"
},
"dependencies": {
"@types/prismjs": "^1.26.0"
},
"keywords": [
"editor",
"code editor",
"textarea",
"small",
"highlight",
"prismjs"
],
"author": "FlameCaster",
"repository": {
"type": "git",
"url": "git+https://github.com/FIameCaster/prism-code-editor.git"
},
"license": "MIT",
"sideEffects": [
"*.css",
"./dist/languages/*",
"./dist/prism-core.js",
"./dist/prism-markdown.js"
],
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
35 changes: 13 additions & 22 deletions package/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const insertText = (

// Only Safari dispatches a beforeinput event
isWebKit || textarea.dispatchEvent(new InputEvent("beforeinput", { data: text }))
console.log(textarea.selectionStart, textarea.selectionEnd)

// Inserting escaped HTML in Chrome and Safari instead for much better performance
if (isChrome || isWebKit) {
// Bug inserting new lines at the end if the editor ends with an empty line
Expand All @@ -124,7 +124,6 @@ const insertText = (
)
if (avoidBug) textarea.selectionStart++
} else document.execCommand(text ? "insertText" : "delete", false, text)
console.log(textarea.selectionStart, textarea.selectionEnd)
if (selection) {
textarea.setSelectionRange(...selection)
setSelection()
Expand Down

0 comments on commit 2b1cb1b

Please sign in to comment.