4 Commits

Author SHA1 Message Date
80597b25d6 1.0.68 2022-05-18 03:19:55 +02:00
bcadb1b97f fix(core): update 2022-05-18 03:19:55 +02:00
e70d8abc8a 1.0.67 2022-03-18 16:56:51 +01:00
c5ef13acbe fix(core): update 2022-03-18 16:56:50 +01:00
10 changed files with 2757 additions and 453 deletions

View File

@ -22,5 +22,6 @@
} }
} }
} }
] ],
"typescript.tsdk": "node_modules/typescript/lib"
} }

View File

@ -17,7 +17,7 @@
} }
</style> </style>
<script type="module" src="./index.ts"></script> <script type="module" src="/bundle.js"></script>
</head> </head>
<body> <body>
</body> </body>

3060
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +1,37 @@
{ {
"name": "@designestate/dees-editor", "name": "@designestate/dees-editor",
"version": "1.0.66", "version": "1.0.68",
"private": false, "private": false,
"description": "an advanced editor for markdown documents based on monaco.", "description": "an advanced editor for markdown documents based on monaco.",
"main": "dist_ts_web/index.js", "main": "dist_ts_web/index.js",
"typings": "dist_ts_web/index.d.ts", "typings": "dist_ts_web/index.d.ts",
"type": "module", "type": "module",
"scripts": { "scripts": {
"test": "npm run build", "test": "tstest test/",
"build": "tsbuild element --allowimplicitany --skiplibcheck && tsbundle element --allowimplicitany", "build": "tsbuild element --allowimplicitany --skiplibcheck && tsbundle element --allowimplicitany",
"watch": "tswatch element" "watch": "tswatch element"
}, },
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {
"@designestate/dees-domtools": "^1.0.41", "@designestate/dees-domtools": "^2.0.1",
"@designestate/dees-element": "^1.0.26", "@designestate/dees-element": "^2.0.2",
"@designestate/dees-wcctools": "^1.0.37", "@designestate/dees-wcctools": "^1.0.37",
"@gitzone/tsrun": "^1.2.31", "@gitzone/tsrun": "^1.2.31",
"@losslessone_private/loint-pubapi": "^1.0.9", "@losslessone_private/loint-pubapi": "^1.0.9",
"@pushrocks/smartexpress": "^3.0.76", "@pushrocks/smartexpress": "^3.0.110",
"monaco-editor": "^0.33.0", "monaco-editor": "^0.33.0",
"typescript": "^4.4.3", "typescript": "^4.4.3",
"xterm": "^4.18.0", "xterm": "^4.18.0",
"xterm-addon-fit": "^0.5.0" "xterm-addon-fit": "^0.5.0"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.56", "@gitzone/tsbuild": "^2.1.59",
"@gitzone/tsbundle": "^1.0.95", "@gitzone/tsbundle": "^1.0.101",
"@gitzone/tswatch": "^1.0.62", "@gitzone/tstest": "^1.0.69",
"@gitzone/tswatch": "^1.0.68",
"@pushrocks/projectinfo": "^4.0.5", "@pushrocks/projectinfo": "^4.0.5",
"@pushrocks/tapbundle": "^5.0.2",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"process": "^0.11.10", "process": "^0.11.10",
"tslint": "^6.1.3", "tslint": "^6.1.3",

15
test/test.browser.ts Normal file
View File

@ -0,0 +1,15 @@
import { expect, expectAsync, tap, webhelpers } from '@pushrocks/tapbundle';
import * as deesEditorLib from '../ts_web/index.js';
tap.test('test dees-editor', async () => {
const deesEditor = new deesEditorLib.DeesEditor;
expect(deesEditor).toBeInstanceOf(deesEditorLib.DeesEditor)
});
tap.test('test dees-terminal', async () => {
const deesTerminal = await webhelpers.fixture(`<dees-terminal></dees-terminal>`);
expect(deesTerminal).toBeInstanceOf(deesEditorLib.DeesTerminal);
})
tap.start()

View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@designestate/dees-editor',
version: '1.0.68',
description: 'an advanced editor for markdown documents based on monaco.'
}

View File

@ -1,82 +0,0 @@
import { DeesElement, property, html, customElement, TemplateResult, css, cssManager } from '@designestate/dees-element';
import * as domtools from '@designestate/dees-domtools';
const deferred = domtools.plugins.smartpromise.defer();
let aceDeferred: typeof deferred;
import type * as monaco from 'monaco-editor';
declare global {
interface HTMLElementTagNameMap {
'dees-editor-ace': DeesEditorAce;
}
}
@customElement('dees-editor-ace')
export class DeesEditorAce extends DeesElement {
public static demo = () => html`
<dees-editor-ace></dees-editor-ace>
`;
constructor() {
super();
domtools.DomTools.setupDomTools();
}
public static styles = [
domtools.elementBasic.staticStyles,
css`
:host {
}
* {
box-sizing: border-box;
}
#container {
position: absolute;
height: 100%;
width: 100%;
}
`
]
public render (): TemplateResult {
return html`
<div class="mainbox">
<div id="container"></div>
</div>
`;
}
public async firstUpdated (_changedProperties: Map<string | number | symbol, unknown>): Promise<void> {
super.firstUpdated(_changedProperties);
const container = this.shadowRoot.getElementById('container');
/* if (!aceDeferred) {
aceDeferred = domtools.plugins.smartpromise.defer();
const scriptUrl = `https://cdn.jsdelivr.net/npm/monaco-editor/min/vs/loader.js`;
const script = document.createElement('script');
script.src = scriptUrl;
script.onload = () => {
aceDeferred.resolve();
}
document.head.appendChild(script);
}
await aceDeferred.promise;
(window as any).require.config({
paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor/min/vs" }
});
(window as any).require([ "vs/editor/editor.main" ], function () {
const editor: monaco.editor.IStandaloneCodeEditor = (window as any).monaco.editor.create(container, {
value: "function hello() {\n\talert('Hello world!');\n}",
language: 'javascript',
theme: 'vs-dark',
useShadowDOM: true
});
}); */
}
}

View File

@ -77,6 +77,9 @@ export class DeesEditor extends DeesElement {
useShadowDOM: true useShadowDOM: true
}); });
}); });
const css = await (await fetch('https://cdn.jsdelivr.net/npm/monaco-editor/min/vs/editor/editor.main.css')).text();
const styleElement = document.createElement('style');
styleElement.textContent = css;
this.shadowRoot.append(styleElement);
} }
} }

View File

@ -1,3 +1,2 @@
export * from './dees-editor.js'; export * from './dees-editor.js';
export * from './dees-editor-ace.js';
export * from './dees-terminal.js'; export * from './dees-terminal.js';

View File

@ -1,16 +1,8 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es2017", "experimentalDecorators": true,
"module": "es2015", "target": "ES2020",
"moduleResolution": "node", "module": "ES2020",
"lib": ["es2017", "dom"], "moduleResolution": "node12"
"declaration": true,
"inlineSources": true,
"inlineSourceMap": true,
"noUnusedLocals": false,
"noFallthroughCasesInSwitch": true,
"outDir": "dist/",
"skipLibCheck": false,
"experimentalDecorators": true
} }
} }