diff --git a/zero.Debug/Startup.cs b/zero.Debug/Startup.cs
index c48fca8d..69228f9e 100644
--- a/zero.Debug/Startup.cs
+++ b/zero.Debug/Startup.cs
@@ -52,15 +52,10 @@ namespace zero.Debug
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
- if (env.IsDevelopment())
- {
- app.UseZeroDevEnvironment();
- }
-
app.UseRouting();
app.UseAuthentication();
- app.UseZero(devPath: Path.Combine(Environment.CurrentDirectory, "..", "zero.Web.UI"));
+ app.UseZero();
app.UseEndpoints(endpoints =>
{
diff --git a/zero.Debug/appsettings.Development.json b/zero.Debug/appsettings.Development.json
index 9afd4250..f4a0247d 100644
--- a/zero.Debug/appsettings.Development.json
+++ b/zero.Debug/appsettings.Development.json
@@ -3,13 +3,18 @@
"Raven": {
"Url": "http://127.0.0.1:9800",
"Database": "laolazero"
+ },
+ "DevServer": {
+ "Port": 2333,
+ "ForwardLog": true
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
- "Microsoft.Hosting.Lifetime": "Information"
+ "Microsoft.Hosting.Lifetime": "Information",
+ "Zero": "Debug"
}
}
}
diff --git a/zero.Web.UI/App/components/forms/rte.pell.dependency.js b/zero.Web.UI/App/components/forms/rte.pell.dependency.js
index 28a0b8be..04ba169c 100644
--- a/zero.Web.UI/App/components/forms/rte.pell.dependency.js
+++ b/zero.Web.UI/App/components/forms/rte.pell.dependency.js
@@ -1,262 +1,247 @@
-(function (global, factory)
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var defaultParagraphSeparatorString = 'defaultParagraphSeparator';
+var formatBlock = 'formatBlock';
+var addEventListener = function addEventListener(parent, type, listener)
{
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- (factory((global.pell = {})));
-}(this, (function (exports)
+ return parent.addEventListener(type, listener);
+};
+var appendChild = function appendChild(parent, child)
{
- 'use strict';
+ return parent.appendChild(child);
+};
+var createElement = function createElement(tag)
+{
+ return document.createElement(tag);
+};
+var queryCommandState = function queryCommandState(command)
+{
+ return document.queryCommandState(command);
+};
+var queryCommandValue = function queryCommandValue(command)
+{
+ return document.queryCommandValue(command);
+};
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+var exec = function exec(command)
+{
+ var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
+ return document.execCommand(command, false, value);
+};
- var defaultParagraphSeparatorString = 'defaultParagraphSeparator';
- var formatBlock = 'formatBlock';
- var addEventListener = function addEventListener(parent, type, listener)
- {
- return parent.addEventListener(type, listener);
- };
- var appendChild = function appendChild(parent, child)
- {
- return parent.appendChild(child);
- };
- var createElement = function createElement(tag)
- {
- return document.createElement(tag);
- };
- var queryCommandState = function queryCommandState(command)
- {
- return document.queryCommandState(command);
- };
- var queryCommandValue = function queryCommandValue(command)
- {
- return document.queryCommandValue(command);
- };
+var defaultActions = {
+ bold: {
+ icon: 'B',
+ title: 'Bold',
+ state: function state()
+ {
+ return queryCommandState('bold');
+ },
+ result: function result()
+ {
+ return exec('bold');
+ }
+ },
+ italic: {
+ icon: 'I',
+ title: 'Italic',
+ state: function state()
+ {
+ return queryCommandState('italic');
+ },
+ result: function result()
+ {
+ return exec('italic');
+ }
+ },
+ underline: {
+ icon: 'U',
+ title: 'Underline',
+ state: function state()
+ {
+ return queryCommandState('underline');
+ },
+ result: function result()
+ {
+ return exec('underline');
+ }
+ },
+ strikethrough: {
+ icon: 'S',
+ title: 'Strike-through',
+ state: function state()
+ {
+ return queryCommandState('strikeThrough');
+ },
+ result: function result()
+ {
+ return exec('strikeThrough');
+ }
+ },
+ heading1: {
+ icon: 'H1',
+ title: 'Heading 1',
+ result: function result()
+ {
+ return exec(formatBlock, '
'); + } + }, + quote: { + icon: '“ ”', + title: 'Quote', + result: function result() + { + return exec(formatBlock, '
');
+ }
+ },
+ olist: {
+ icon: '',
+ title: 'Ordered List',
+ result: function result()
+ {
+ return exec('insertOrderedList');
+ }
+ },
+ ulist: {
+ icon: '',
+ title: 'Unordered List',
+ result: function result()
+ {
+ return exec('insertUnorderedList');
+ }
+ },
+ code: {
+ icon: '</>',
+ title: 'Code',
+ result: function result()
+ {
+ return exec(formatBlock, '');
+ }
+ },
+ line: {
+ icon: '',
+ title: 'Horizontal Line',
+ result: function result()
+ {
+ return exec('insertHorizontalRule');
+ }
+ },
+ link: {
+ icon: '',
+ title: 'Link',
+ result: function result()
+ {
+ var url = window.prompt('Enter the link URL');
+ if (url) exec('createLink', url);
+ }
+ },
+ image: {
+ icon: '📷',
+ title: 'Image',
+ result: function result()
+ {
+ var url = window.prompt('Enter the image URL');
+ if (url) exec('insertImage', url);
+ }
+ }
+};
- var exec = function exec(command)
- {
- var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- return document.execCommand(command, false, value);
- };
+var defaultClasses = {
+ actionbar: 'pell-actionbar',
+ button: 'pell-button',
+ content: 'pell-content',
+ selected: 'pell-button-selected'
+};
- var defaultActions = {
- bold: {
- icon: 'B',
- title: 'Bold',
- state: function state()
+var init = function init(settings)
+{
+ var actions = settings.actions ? settings.actions.map(function (action)
+ {
+ if (typeof action === 'string') return defaultActions[action]; else if (defaultActions[action.name]) return _extends({}, defaultActions[action.name], action);
+ return action;
+ }) : Object.keys(defaultActions).map(function (action)
+ {
+ return defaultActions[action];
+ });
+
+ var classes = _extends({}, defaultClasses, settings.classes);
+
+ var defaultParagraphSeparator = settings[defaultParagraphSeparatorString] || 'div';
+
+ var actionbar = createElement('div');
+ actionbar.className = classes.actionbar;
+ appendChild(settings.element, actionbar);
+
+ var content = settings.element.content = createElement('div');
+ content.contentEditable = true;
+ content.className = classes.content;
+ content.oninput = function (_ref)
+ {
+ var firstChild = _ref.target.firstChild;
+
+ if (firstChild && firstChild.nodeType === 3) exec(formatBlock, '<' + defaultParagraphSeparator + '>'); else if (content.innerHTML === '
') content.innerHTML = '';
+ settings.onChange(content.innerHTML);
+ };
+ content.onkeydown = function (event)
+ {
+ if (event.key === 'Enter' && queryCommandValue(formatBlock) === 'blockquote')
+ {
+ setTimeout(function ()
{
- return queryCommandState('bold');
- },
- result: function result()
- {
- return exec('bold');
- }
- },
- italic: {
- icon: 'I',
- title: 'Italic',
- state: function state()
- {
- return queryCommandState('italic');
- },
- result: function result()
- {
- return exec('italic');
- }
- },
- underline: {
- icon: 'U',
- title: 'Underline',
- state: function state()
- {
- return queryCommandState('underline');
- },
- result: function result()
- {
- return exec('underline');
- }
- },
- strikethrough: {
- icon: 'S',
- title: 'Strike-through',
- state: function state()
- {
- return queryCommandState('strikeThrough');
- },
- result: function result()
- {
- return exec('strikeThrough');
- }
- },
- heading1: {
- icon: 'H1',
- title: 'Heading 1',
- result: function result()
- {
- return exec(formatBlock, '');
- }
- },
- heading2: {
- icon: 'H2',
- title: 'Heading 2',
- result: function result()
- {
- return exec(formatBlock, '');
- }
- },
- paragraph: {
- icon: '¶',
- title: 'Paragraph',
- result: function result()
- {
- return exec(formatBlock, '
');
- }
- },
- quote: {
- icon: '“ ”',
- title: 'Quote',
- result: function result()
- {
- return exec(formatBlock, '
');
- }
- },
- olist: {
- icon: '',
- title: 'Ordered List',
- result: function result()
- {
- return exec('insertOrderedList');
- }
- },
- ulist: {
- icon: '',
- title: 'Unordered List',
- result: function result()
- {
- return exec('insertUnorderedList');
- }
- },
- code: {
- icon: '</>',
- title: 'Code',
- result: function result()
- {
- return exec(formatBlock, '');
- }
- },
- line: {
- icon: '',
- title: 'Horizontal Line',
- result: function result()
- {
- return exec('insertHorizontalRule');
- }
- },
- link: {
- icon: '',
- title: 'Link',
- result: function result()
- {
- var url = window.prompt('Enter the link URL');
- if (url) exec('createLink', url);
- }
- },
- image: {
- icon: '📷',
- title: 'Image',
- result: function result()
- {
- var url = window.prompt('Enter the image URL');
- if (url) exec('insertImage', url);
- }
+ return exec(formatBlock, '<' + defaultParagraphSeparator + '>');
+ }, 0);
}
};
+ appendChild(settings.element, content);
- var defaultClasses = {
- actionbar: 'pell-actionbar',
- button: 'pell-button',
- content: 'pell-content',
- selected: 'pell-button-selected'
- };
-
- var init = function init(settings)
+ actions.forEach(function (action)
{
- var actions = settings.actions ? settings.actions.map(function (action)
+ var button = createElement('button');
+ button.className = classes.button;
+ button.innerHTML = action.icon;
+ button.title = action.title;
+ button.setAttribute('type', 'button');
+ button.onclick = function ()
{
- if (typeof action === 'string') return defaultActions[action]; else if (defaultActions[action.name]) return _extends({}, defaultActions[action.name], action);
- return action;
- }) : Object.keys(defaultActions).map(function (action)
- {
- return defaultActions[action];
- });
-
- var classes = _extends({}, defaultClasses, settings.classes);
-
- var defaultParagraphSeparator = settings[defaultParagraphSeparatorString] || 'div';
-
- var actionbar = createElement('div');
- actionbar.className = classes.actionbar;
- appendChild(settings.element, actionbar);
-
- var content = settings.element.content = createElement('div');
- content.contentEditable = true;
- content.className = classes.content;
- content.oninput = function (_ref)
- {
- var firstChild = _ref.target.firstChild;
-
- if (firstChild && firstChild.nodeType === 3) exec(formatBlock, '<' + defaultParagraphSeparator + '>'); else if (content.innerHTML === '
') content.innerHTML = '';
- settings.onChange(content.innerHTML);
+ return action.result() && content.focus();
};
- content.onkeydown = function (event)
- {
- if (event.key === 'Enter' && queryCommandValue(formatBlock) === 'blockquote')
- {
- setTimeout(function ()
- {
- return exec(formatBlock, '<' + defaultParagraphSeparator + '>');
- }, 0);
- }
- };
- appendChild(settings.element, content);
- actions.forEach(function (action)
+ if (action.state)
{
- var button = createElement('button');
- button.className = classes.button;
- button.innerHTML = action.icon;
- button.title = action.title;
- button.setAttribute('type', 'button');
- button.onclick = function ()
+ var handler = function handler()
{
- return action.result() && content.focus();
+ return button.classList[action.state() ? 'add' : 'remove'](classes.selected);
};
+ addEventListener(content, 'keyup', handler);
+ addEventListener(content, 'mouseup', handler);
+ addEventListener(button, 'click', handler);
+ }
- if (action.state)
- {
- var handler = function handler()
- {
- return button.classList[action.state() ? 'add' : 'remove'](classes.selected);
- };
- addEventListener(content, 'keyup', handler);
- addEventListener(content, 'mouseup', handler);
- addEventListener(button, 'click', handler);
- }
+ appendChild(actionbar, button);
+ });
- appendChild(actionbar, button);
- });
+ if (settings.styleWithCSS) exec('styleWithCSS');
+ exec(defaultParagraphSeparatorString, defaultParagraphSeparator);
- if (settings.styleWithCSS) exec('styleWithCSS');
- exec(defaultParagraphSeparatorString, defaultParagraphSeparator);
+ return settings.element;
+};
- return settings.element;
- };
- var pell = { exec: exec, init: init };
-
- exports.exec = exec;
- exports.init = init;
- exports['default'] = pell;
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
+export default { exec, init };
\ No newline at end of file
diff --git a/zero.Web.UI/App/components/globals.js b/zero.Web.UI/App/components/globals.js
deleted file mode 100644
index cbb13e49..00000000
--- a/zero.Web.UI/App/components/globals.js
+++ /dev/null
@@ -1,47 +0,0 @@
-// Globally register all base components for convenience, because they
-// will be used very frequently. Components are registered using the
-// PascalCased version of their file name.
-
-import Vue from 'vue';
-
-//const directories = ['buttons', 'forms', 'messages', 'tables', 'tabs'];
-
-// TODO this file will import all vue component files with subdirectories
-// if it contains a file "overlay.vue" it will create an "ui-overlay" component
-// if another folder contains a file "overlay.vue" it is not used anymore or overridden.
-// we don't want to add all files but only files where we define global component access in its settings
-
-// https://webpack.js.org/guides/dependency-management/#require-context
-const requireComponent = require.context(
- // Look for files in the current directory
- '.',
- // Do look in subdirectories
- true,
- // .vue files
- /[\w-]+\.vue$/
-);
-
-// For each matching file name...
-requireComponent.keys().forEach((path) =>
-{
- let pathParts = path.split('/');
- let fileName = pathParts[pathParts.length - 1];
-
- // Get the component config
- const componentConfig = requireComponent(path);
- // Get the PascalCase version of the component name
- const componentName = 'ui' + fileName
- // Remove the "./_" from the beginning
- .replace(/^\.\/_/, '')
- // Remove the file extension from the end
- .replace(/\.\w+$/, '')
- // Split up kebabs
- .split('-')
- // Upper case
- .map((kebab) => kebab.charAt(0).toUpperCase() + kebab.slice(1))
- // Concatenated
- .join('');
-
- // Globally register the component
- Vue.component(componentName, componentConfig.default || componentConfig);
-});
\ No newline at end of file
diff --git a/zero.Web.UI/App/components/modules/module-preview.vue b/zero.Web.UI/App/components/modules/module-preview.vue
index afb5364a..81b3780d 100644
--- a/zero.Web.UI/App/components/modules/module-preview.vue
+++ b/zero.Web.UI/App/components/modules/module-preview.vue
@@ -2,7 +2,7 @@
-
+
{{alias}}
@@ -29,10 +29,13 @@
\ No newline at end of file
diff --git a/zero.Web.UI/App/core/plugin.zero.js b/zero.Web.UI/App/core/plugin.zero.js
index e997ab58..c3fdc027 100644
--- a/zero.Web.UI/App/core/plugin.zero.js
+++ b/zero.Web.UI/App/core/plugin.zero.js
@@ -1,5 +1,5 @@
-import Plugin from './plugin.js';
+import Plugin from './plugin.ts';
import editors from '../renderers/editors/all.js';
import lists from '../renderers/lists/all.js';
import routes from './routes.js';
diff --git a/zero.Web.UI/App/editor/editor-component.vue b/zero.Web.UI/App/editor/editor-component.vue
index c04c5d37..3ee1d3c4 100644
--- a/zero.Web.UI/App/editor/editor-component.vue
+++ b/zero.Web.UI/App/editor/editor-component.vue
@@ -9,8 +9,8 @@