Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
4080e43
extracting and exporting options as props for user to configure
frantic0 Nov 25, 2019
303559e
added my own fork to the package
frantic0 Nov 25, 2019
08fe6c6
testing my svelte-codemirror with options as props
frantic0 Nov 25, 2019
9366441
exposed code-mirror options as props
frantic0 Nov 25, 2019
2f016c6
correct bug on new_options
frantic0 Nov 25, 2019
5e1a97d
fixing error type error
frantic0 Nov 25, 2019
9dadb08
scoping error set and get
frantic0 Nov 25, 2019
0e41cab
set and update
frantic0 Nov 25, 2019
dc884a2
rolling back and starting over
frantic0 Nov 26, 2019
be0c1bc
added callback mechanism for exposing dynamic commands to svelte-code…
frantic0 Nov 26, 2019
f33f79a
added sema styles
frantic0 Dec 1, 2019
644641a
added export function getBlock
frantic0 Jan 14, 2020
01988c2
fixed duplicated code
frantic0 Jan 14, 2020
b6c09aa
export function with no args
frantic0 Jan 14, 2020
5d9560a
added export functions getSelection and getBlock
frantic0 Jan 14, 2020
b2273a0
added getSelection
frantic0 Jan 14, 2020
e1912be
adding theme
frantic0 Feb 2, 2020
33b7964
added monokai as default
frantic0 Feb 2, 2020
1e77a4c
added themes to createEditor and new hash of themes
frantic0 Feb 2, 2020
6184056
making theme optional
frantic0 Feb 2, 2020
153061c
theme requires only string, updated on createEditor
frantic0 Feb 2, 2020
a657b99
new function set
frantic0 Feb 2, 2020
e1a02a2
new approach
frantic0 Feb 2, 2020
bb5a096
new approach
frantic0 Feb 2, 2020
3627f4d
new approach
frantic0 Feb 2, 2020
c860432
new approach
frantic0 Feb 2, 2020
5eb85f3
new approach
frantic0 Feb 2, 2020
a7e4d7a
new approach
frantic0 Feb 2, 2020
499747f
new approach
frantic0 Feb 2, 2020
d06ac7b
added getValue
frantic0 Feb 3, 2020
abd0865
Add ctrl period
ulyssesdotcodes Feb 5, 2020
1cdaef3
Merge pull request #1 from ulyssesp/up/ctrl-period
frantic0 Feb 24, 2020
92f664e
new command forward slash
frantic0 Mar 6, 2020
cdd837d
Merge branch 'master' of https://github.com/frantic0/svelte-codemirror
frantic0 Mar 6, 2020
274bb4f
added new commands with cmd and ctrl as extraKeys
frantic0 Mar 6, 2020
553041b
adding support for Search/Replace through CodeMirror plugin
frantic0 Mar 6, 2020
b44eec5
removed cmd-/ to test code-mirror comment plugin
frantic0 Mar 6, 2020
c9d7c05
added toggleComment support with comment add-on
frantic0 Mar 7, 2020
f1f9308
disabling cmd-/
frantic0 Mar 7, 2020
0dbab2a
bound cmdForwardSlash to toggleCommand on extraKeys
frantic0 Mar 10, 2020
20794e5
adding anon func to toggle command
frantic0 Mar 10, 2020
06c0ce9
nailed it
frantic0 Mar 10, 2020
541536e
refactored exported methods on demo; commented debug message on "change"
frantic0 Mar 15, 2020
9130513
debugging onchange
frantic0 Mar 23, 2020
0d9ce9d
send details from the change event
chriskiefer Mar 24, 2020
7224845
getLine exposed
chriskiefer Mar 24, 2020
928518a
Merge branch 'master' into master
frantic0 Mar 27, 2020
01c9422
Merge pull request #2 from mimic-sussex/master
frantic0 Mar 27, 2020
7f0b7c0
get cursor pos and range
chriskiefer Apr 21, 2020
e029bc8
Merge remote-tracking branch 'origin/master'
chriskiefer Apr 21, 2020
1a9264f
tidy
chriskiefer Apr 21, 2020
efed948
getcursor/range
chriskiefer Apr 23, 2020
df8e0a2
export functions
chriskiefer Apr 23, 2020
ff62ea8
propagating events focus blur refresh; updated demo
frantic0 Jun 10, 2020
2ca4c12
Merge pull request #3 from mimic-sussex/master
frantic0 Jun 10, 2020
faad940
exposed more codemirror native events
frantic0 Jun 10, 2020
e1a92f2
Merge branch 'master' of https://github.com/frantic0/svelte-codemirror
frantic0 Jun 10, 2020
971496f
added event wrappers
frantic0 Jun 10, 2020
817de4f
bump "codemirror" "^5.54.0"
frantic0 Jun 16, 2020
9e16e33
bumped dependencies
frantic0 Jun 16, 2020
ff7da8f
added sourcemap generation
frantic0 Feb 21, 2021
b68b2a0
generated sourcemaps
frantic0 Feb 21, 2021
6d150da
bumped svelte, rollup, plugin node resolve, rollup plugin svelte
frantic0 Feb 22, 2021
c6409bf
remove codemirror instance methods set getvalue
frantic0 Feb 22, 2021
ff1765d
added getCurrentCursorPosition selectAll setCursorPosition wrappers
frantic0 Apr 14, 2021
9d522e1
changed selectAll impl; exposed editor
frantic0 Apr 14, 2021
cae6f80
added focus and setCursor
frantic0 Apr 14, 2021
1bd1f3e
added focus and setCursor
frantic0 Apr 14, 2021
cdcdac8
removing `intelligent` behaviour from editor
frantic0 Apr 23, 2021
ebca08b
commented flex prop
frantic0 Apr 23, 2021
e91ced6
changing export attribute to prop editor
frantic0 Apr 23, 2021
225d7d8
all properties on top of the script; removed binding for error highli…
frantic0 Apr 23, 2021
e02288f
Added autocomplete functionality
May 15, 2021
3b0b68e
Update CodeMirror.svelte
May 15, 2021
749fd65
testing mousemove event cancellation
frantic0 May 17, 2021
1aa351a
building test case to show CodeMirror interference on document.addEve…
frantic0 May 17, 2021
8b8b02c
added mousemove test
frantic0 May 17, 2021
095fe95
Merge pull request #6 from egemenertugrul/master
frantic0 May 17, 2021
8bca3ef
removed mousemouve handler
frantic0 May 17, 2021
f02bb4c
Merge branch 'master' of https://github.com/frantic0/svelte-codemirror
frantic0 May 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/demo/src/routes",
// "webRoot": "${workspaceFolder}/"
// "webRoot": "${workspaceFolder}/demo/src/routes"
// "webRoot": "${workspaceFolder}/demo/src/routes"
}
]
}
Empty file added README.md
Empty file.
2,522 changes: 1,610 additions & 912 deletions demo/package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
"dependencies": {
"compression": "^1.7.1",
"polka": "^0.5.0",
"sirv": "^0.4.0",
"svelte-codemirror": "^1.2.0"
"sirv": "^0.4.0"
},
"devDependencies": {
"npm-run-all": "^4.1.5",
"sapper": "^0.27.0",
"svelte": "^3.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/runtime": "^7.0.0",
"rollup": "^1.0.0",
"rollup-plugin-babel": "^4.0.2",
"rollup-plugin-commonjs": "^9.1.6",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-svelte": "^5.0.1",
"rollup-plugin-terser": "^4.0.4"
"@rollup/plugin-babel": "^5.0.3",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"@rollup/plugin-replace": "^2.3.3",
"npm-run-all": "^4.1.5",
"rollup": "^2.39.0",
"rollup-plugin-svelte": "^5.2.2",
"rollup-plugin-terser": "^6.1.0",
"sapper": "^0.27.0",
"svelte": "^3.15.0",
"svelte-codemirror": "git+https://github.com/frantic0/svelte-codemirror.git"
}
}
78 changes: 44 additions & 34 deletions demo/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import resolve from 'rollup-plugin-node-resolve';
import replace from 'rollup-plugin-replace';
import commonjs from 'rollup-plugin-commonjs';
import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import commonjs from "@rollup/plugin-commonjs";
import svelte from 'rollup-plugin-svelte';
import babel from 'rollup-plugin-babel';
import babel from "@rollup/plugin-babel";
import { terser } from 'rollup-plugin-terser';
import config from 'sapper/config/rollup.js';
import pkg from './package.json';
Expand All @@ -17,10 +17,11 @@ export default {
client: {
input: config.client.input(),
output: config.client.output(),
// sourcemap: true,
plugins: [
replace({
'process.browser': true,
'process.env.NODE_ENV': JSON.stringify(mode)
"process.browser": true,
"process.env.NODE_ENV": JSON.stringify(mode)
}),
svelte({
dev,
Expand All @@ -32,51 +33,60 @@ export default {
}),
commonjs(),

legacy && babel({
extensions: ['.js', '.mjs', '.html', '.svelte'],
runtimeHelpers: true,
exclude: ['node_modules/@babel/**'],
presets: [
['@babel/preset-env', {
targets: '> 0.25%, not dead'
}]
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-transform-runtime', {
useESModules: true
}]
]
}),
legacy &&
babel({
extensions: [".js", ".mjs", ".html", ".svelte"],
runtimeHelpers: true,
exclude: ["node_modules/@babel/**"],
presets: [
[
"@babel/preset-env",
{
targets: "> 0.25%, not dead"
}
]
],
plugins: [
"@babel/plugin-syntax-dynamic-import",
[
"@babel/plugin-transform-runtime",
{
useESModules: true
}
]
]
}),

!dev && terser({
module: true
})
!dev &&
terser({
module: true
})
],

onwarn,
onwarn
},

server: {
input: config.server.input(),
output: config.server.output(),
plugins: [
replace({
'process.browser': false,
'process.env.NODE_ENV': JSON.stringify(mode)
"process.browser": false,
"process.env.NODE_ENV": JSON.stringify(mode)
}),
svelte({
generate: 'ssr',
generate: "ssr",
dev
}),
resolve(),
commonjs()
],
external: Object.keys(pkg.dependencies).concat(
require('module').builtinModules || Object.keys(process.binding('natives'))
require("module").builtinModules ||
Object.keys(process.binding("natives"))
),

onwarn,
onwarn
},

serviceworker: {
Expand All @@ -85,13 +95,13 @@ export default {
plugins: [
resolve(),
replace({
'process.browser': true,
'process.env.NODE_ENV': JSON.stringify(mode)
"process.browser": true,
"process.env.NODE_ENV": JSON.stringify(mode)
}),
commonjs(),
!dev && terser()
],

onwarn,
onwarn
}
};
31 changes: 25 additions & 6 deletions demo/src/codeMirrorPlugins.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
import "codemirror/mode/javascript/javascript.js";
// import 'codemirror/mode/shell/shell.js';
import "codemirror/mode/handlebars/handlebars.js";
import "codemirror/mode/htmlmixed/htmlmixed.js";
import "codemirror/mode/xml/xml.js";
import "codemirror/mode/css/css.js";
import 'codemirror/mode/javascript/javascript.js';
import 'codemirror/mode/shell/shell.js';
import 'codemirror/mode/ebnf/ebnf';
import 'codemirror/mode/handlebars/handlebars.js';
import 'codemirror/mode/htmlmixed/htmlmixed.js';
import 'codemirror/mode/xml/xml.js';
import 'codemirror/mode/css/css.js';
import 'codemirror/mode/asn.1/asn.1.js';
import 'codemirror/mode/clojure/clojure.js';
import 'codemirror/lib/codemirror.css';
import 'codemirror/keymap/vim.js';
import 'codemirror/theme/monokai.css';
import 'codemirror/theme/icecoder.css';
import "codemirror/addon/edit/closebrackets.js";
import "codemirror/addon/edit/closetag.js";
import 'codemirror/theme/shadowfox.css';
import 'codemirror/theme/cobalt.css';
import 'codemirror/addon/search/search.js';
import 'codemirror/addon/search/searchcursor.js';
import 'codemirror/addon/search/jump-to-line.js';
import "codemirror/addon/dialog/dialog.js";
import "codemirror/addon/dialog/dialog.css";
import "codemirror/addon/comment/comment.js";
import "codemirror/addon/comment/continuecomment.js";

// import './theme.css';
// import "./sema.css";
44 changes: 44 additions & 0 deletions demo/src/icecoder.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

/*
ICEcoder default theme by Matt Pass, used in code editor available at https://icecoder.net
*/

.cm-s-icecoder { color: #666; background: #1d1d1b; }

.cm-s-icecoder span.cm-keyword { color: #eee; font-weight:bold; } /* off-white 1 */
.cm-s-icecoder span.cm-atom { color: #e1c76e; } /* yellow */
.cm-s-icecoder span.cm-number { color: #6cb5d9; } /* blue */
.cm-s-icecoder span.cm-def { color: #b9ca4a; } /* green */

.cm-s-icecoder span.cm-variable { color: #6cb5d9; } /* blue */
.cm-s-icecoder span.cm-variable-2 { color: #cc1e5c; } /* pink */
.cm-s-icecoder span.cm-variable-3, .cm-s-icecoder span.cm-type { color: #f9602c; } /* orange */

.cm-s-icecoder span.cm-property { color: #eee; } /* off-white 1 */
.cm-s-icecoder span.cm-operator { color: #9179bb; } /* purple */
.cm-s-icecoder span.cm-comment { color: #97a3aa; } /* grey-blue */

.cm-s-icecoder span.cm-string { color: #b9ca4a; } /* green */
.cm-s-icecoder span.cm-string-2 { color: #6cb5d9; } /* blue */

.cm-s-icecoder span.cm-meta { color: #555; } /* grey */

.cm-s-icecoder span.cm-qualifier { color: #555; } /* grey */
.cm-s-icecoder span.cm-builtin { color: #214e7b; } /* bright blue */
.cm-s-icecoder span.cm-bracket { color: #cc7; } /* grey-yellow */

.cm-s-icecoder span.cm-tag { color: #e8e8e8; } /* off-white 2 */
.cm-s-icecoder span.cm-attribute { color: #099; } /* teal */

.cm-s-icecoder span.cm-header { color: #6a0d6a; } /* purple-pink */
.cm-s-icecoder span.cm-quote { color: #186718; } /* dark green */
.cm-s-icecoder span.cm-hr { color: #888; } /* mid-grey */
.cm-s-icecoder span.cm-link { color: #e1c76e; } /* yellow */
.cm-s-icecoder span.cm-error { color: #d00; } /* red */

.cm-s-icecoder .CodeMirror-cursor { border-left: 1px solid white; }
.cm-s-icecoder div.CodeMirror-selected { color: #fff; background: #037; }
.cm-s-icecoder .CodeMirror-gutters { background: #1d1d1b; min-width: 41px; border-right: 0; }
.cm-s-icecoder .CodeMirror-linenumber { color: #555; cursor: default; }
.cm-s-icecoder .CodeMirror-matchingbracket { color: #fff !important; background: #555 !important; }
.cm-s-icecoder .CodeMirror-activeline-background { background: #000; }
2 changes: 1 addition & 1 deletion demo/src/routes/_layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
main {
position: relative;
background-color: white;
padding: 2em;
/* padding: 0.1em; */
margin: 0 auto;
box-sizing: border-box;
}
Expand Down
Loading