diff --git a/bundle.js b/bundle.js index d1341a0..34ce634 100644 --- a/bundle.js +++ b/bundle.js @@ -1,6 +1,8 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i res.text()).then(async source => { - const module = { exports: {} } - const f = new Function('module', 'require', source) - f(module, require) - const init = module.exports - await init(args, prefix) - require('./page') // or whatever is otherwise the main entry of our project -}) - -},{"./page":26}],26:[function(require,module,exports){ +},{"STATE":1,"space":17,"taskbar":23}],25:[function(require,module,exports){ (function (__filename){(function (){ -const STATE = require('../src/node_modules/STATE') +const STATE = require('STATE') const statedb = STATE(__filename) const admin_api = statedb.admin() const admin_on = {} @@ -8435,13 +8414,13 @@ async function boot(opts) { const files = admin.status.db.read([root, ds_id]).files || [] result[root][type][name][ds_id] = {} files.forEach(file_id => { - result[root][type][name][ds_id][file_id] = admin.status.db.read([root, file_id]) + result[root][type][name][ds_id][file_id] = admin.status.db.read([root, file_id]) }) }) }) }) }) - + const editor_id = admin.status.a2i[admin.status.s2i[editor_subs[0].sid]] const port = await item.get(editor_id) // await io.at(editor_id) @@ -8639,19 +8618,19 @@ function fallback_module() { .components-wrapper-container { padding-top: 10px; /* Adjust as needed */ } - + .components-wrapper { width: 95%; margin: 0 auto; padding: 2.5%; } - + .component-outer-wrapper { margin-bottom: 20px; padding: 0px 0px 10px 0px; transition: background-color 0.3s ease; } - + .component-name-label { background-color:transparent; padding: 8px 15px; @@ -8659,7 +8638,7 @@ function fallback_module() { font-weight: bold; color: #333; } - + .component-wrapper { position: relative; padding: 15px; @@ -8782,4 +8761,4 @@ function fallback_module() { } }).call(this)}).call(this,"/web/page.js") -},{"../src/node_modules/STATE":3,"../src/node_modules/action_bar":4,"../src/node_modules/actions":5,"../src/node_modules/console_history":6,"../src/node_modules/graph_explorer_wrapper":9,"../src/node_modules/helpers":10,"../src/node_modules/manager":12,"../src/node_modules/menu":13,"../src/node_modules/quick_actions":15,"../src/node_modules/quick_editor":16,"../src/node_modules/space":17,"../src/node_modules/steps_wizard":18,"../src/node_modules/tabbed_editor":19,"../src/node_modules/tabs":20,"../src/node_modules/tabsbar":21,"../src/node_modules/task_manager":22,"../src/node_modules/taskbar":23,"../src/node_modules/theme_widget":24}]},{},[25]); +},{"../src/node_modules/action_bar":4,"../src/node_modules/actions":5,"../src/node_modules/console_history":6,"../src/node_modules/graph_explorer_wrapper":9,"../src/node_modules/helpers":10,"../src/node_modules/manager":12,"../src/node_modules/menu":13,"../src/node_modules/quick_actions":15,"../src/node_modules/quick_editor":16,"../src/node_modules/space":17,"../src/node_modules/steps_wizard":18,"../src/node_modules/tabbed_editor":19,"../src/node_modules/tabs":20,"../src/node_modules/tabsbar":21,"../src/node_modules/task_manager":22,"../src/node_modules/taskbar":23,"../src/node_modules/theme_widget":24,"STATE":1}]},{},[25]); diff --git a/index.html b/index.html index 18dc4ba..0ac2213 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,5 @@ - - - - - - - + + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..75eb21c --- /dev/null +++ b/index.js @@ -0,0 +1,5 @@ +const env = { version: 'latest' } +const arg = { x: 321, y: 543 } +const url = 'https://playproject.io/datashell/shim.js' +const src = `${url}?${new URLSearchParams(env)}#${new URLSearchParams(arg)}` +this.open ? document.body.append(Object.assign(document.createElement('script'), { src })) : importScripts(src) \ No newline at end of file diff --git a/package.json b/package.json index 5677ce3..d4d41fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "theme-wiget", - "version": "0.0.1", + "name": "ui-components", + "version": "0.0.2-pre-alpha", "description": "An app for debuging and testing website's theme. It is a simple app that allows you to change the theme of a website and see the changes in real time. It has 4 components: action-bar(action-wizard),graph-explorer,tabbed-editor,action-history", "homepage": "https://github.com/ddroid/ui-components#readme", "bugs": { @@ -15,10 +15,8 @@ "type": "commonjs", "main": "src/index.js", "scripts": { - "start": "budo web/boot.js:bundle.js --open --live", - "build": "browserify web/boot.js -o bundle.js", - "start:act": "budo web/boot.js:bundle.js --dir ./ --live --open", - "build:act": "browserify web/boot.js > bundle.js", + "start": "budo web/page.js:bundle.js --dir . --live --open -- -i STATE", + "build": "browserify web/page.js -i STATE -o bundle.js", "lint": "standardx" }, "devDependencies": { diff --git a/web/boot.js b/web/boot.js deleted file mode 100644 index 6749e09..0000000 --- a/web/boot.js +++ /dev/null @@ -1,19 +0,0 @@ -const prefix = 'https://raw.githubusercontent.com/alyhxn/playproject/main/' -const init_url = location.hash === '#dev' ? 'web/init.js' : prefix + 'src/node_modules/init.js' -const args = arguments - -const has_save = location.hash.includes('#save') -const fetch_opts = has_save ? {} : { cache: 'no-store' } - -if (!has_save) { - localStorage.clear() -} - -fetch(init_url, fetch_opts).then(res => res.text()).then(async source => { - const module = { exports: {} } - const f = new Function('module', 'require', source) - f(module, require) - const init = module.exports - await init(args, prefix) - require('./page') // or whatever is otherwise the main entry of our project -}) diff --git a/web/page.js b/web/page.js index 453e0a8..6797a6e 100644 --- a/web/page.js +++ b/web/page.js @@ -1,4 +1,4 @@ -const STATE = require('../src/node_modules/STATE') +const STATE = require('STATE') const statedb = STATE(__filename) const admin_api = statedb.admin() const admin_on = {} @@ -317,13 +317,13 @@ async function boot(opts) { const files = admin.status.db.read([root, ds_id]).files || [] result[root][type][name][ds_id] = {} files.forEach(file_id => { - result[root][type][name][ds_id][file_id] = admin.status.db.read([root, file_id]) + result[root][type][name][ds_id][file_id] = admin.status.db.read([root, file_id]) }) }) }) }) }) - + const editor_id = admin.status.a2i[admin.status.s2i[editor_subs[0].sid]] const port = await item.get(editor_id) // await io.at(editor_id) @@ -521,19 +521,19 @@ function fallback_module() { .components-wrapper-container { padding-top: 10px; /* Adjust as needed */ } - + .components-wrapper { width: 95%; margin: 0 auto; padding: 2.5%; } - + .component-outer-wrapper { margin-bottom: 20px; padding: 0px 0px 10px 0px; transition: background-color 0.3s ease; } - + .component-name-label { background-color:transparent; padding: 8px 15px; @@ -541,7 +541,7 @@ function fallback_module() { font-weight: bold; color: #333; } - + .component-wrapper { position: relative; padding: 15px;