apprun 3.33.7 → 3.33.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"./jsx-runtime.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,yDCuFT,IAAIC,EACJ,MAAMP,EAAwB,iBAATQ,MAAqBA,KAAKA,OAASA,MAAQA,MAC3C,iBAAX,EAAAC,GAAuB,EAAAA,EAAOC,SAAW,EAAAD,GAAU,EAAAA,EACzDT,EAAU,KAAKA,EAAsB,gBACvCO,EAAMP,EAAU,KAEhBO,EAAM,IArGD,MAcL,WAAAI,GACEL,KAAKM,QAAU,CAAC,CAClB,CAEA,EAAAC,CAAGC,EAAcC,EAAuBC,EAAwB,CAAC,GAC/DV,KAAKM,QAAQE,GAAQR,KAAKM,QAAQE,IAAS,GAC3CR,KAAKM,QAAQE,GAAMG,KAAK,CAAEF,KAAIC,WAChC,CAEA,GAAAE,CAAIJ,EAAcC,GAChB,MAAMI,EAAcb,KAAKM,QAAQE,IAAS,GAE1CR,KAAKM,QAAQE,GAAQK,EAAYC,QAAQC,GAAQA,EAAIN,KAAOA,GAC9D,CAEA,IAAAO,CAAKR,GACH,OAAOR,KAAKM,QAAQE,EACtB,CAEA,GAAAS,CAAIT,KAAiBU,GACnB,MAAML,EAAcb,KAAKmB,eAAeX,EAAMR,KAAKM,SAYnD,OAXAc,QAAQC,OAAOR,GAAeA,EAAYS,OAAS,EAAG,4BAA8Bd,GACpFK,EAAYU,SAASR,IACnB,MAAM,GAAEN,EAAE,QAAEC,GAAYK,EAMxB,OALIL,EAAQc,MACVxB,KAAKwB,MAAMhB,EAAMC,EA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AKO,SAAS3B,KAAIgF,GAASzB,EAAgByB,EAAO0D,EAAY9F,M,MAE9ExB,EAAKO,SAAWP,EAAKO,SAAS3B,KAAIgF,GAASzB,EAAgByB,EAAO1B,EAAQyE,M,CAG9E,OAAO3G,CACT,C,GCjRIwH,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBhG,IAAjBiG,EACH,OAAOA,EAAarL,QAGrB,IAAIC,EAASiL,EAAyBE,GAAY,CAGjDpL,QAAS,CAAC,GAOX,OAHAsL,EAAoBF,GAAUnL,EAAQA,EAAOD,QAASmL,GAG/ClL,EAAOD,OACf,CCrBAmL,EAAoB9C,EAAI,CAACrI,EAASuL,KACjC,IAAI,IAAIrH,KAAOqH,EACXJ,EAAoBK,EAAED,EAAYrH,KAASiH,EAAoBK,EAAExL,EAASkE,IAC5ErC,OAAO4J,eAAezL,EAASkE,EAAK,CAAEwH,YAAY,EAAMC,IAAKJ,EAAWrH,IAE1E,ECNDiH,EAAoB5K,EAAI,WACvB,GAA0B,iBAAfqL,WAAyB,OAAOA,WAC3C,IACC,OAAOxL,MAAQ,IAAIyL,SAAS,cAAb,EAChB,CAAE,MAAOzH,GACR,GAAsB,iBAAX+F,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBgB,EAAoBK,EAAI,CAACM,EAAKC,IAAUlK,OAAOmK,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFZ,EAAoBgB,EAAKnM,IACH,oBAAXoM,QAA0BA,OAAOC,aAC1CxK,OAAO4J,eAAezL,EAASoM,OAAOC,YAAa,CAAE/I,MAAO,WAE7DzB,OAAO4J,eAAezL,EAAS,aAAc,CAAEsD,OAAO,GAAO,E","sources":["webpack://apprun/webpack/universalModuleDefinition","webpack://apprun/./src/app.ts","webpack://apprun/./src/directive.ts","webpack://apprun/./src/vdom-my.ts","webpack://apprun/webpack/bootstrap","webpack://apprun/webpack/runtime/define property getters","webpack://apprun/webpack/runtime/global","webpack://apprun/webpack/runtime/hasOwnProperty shorthand","webpack://apprun/webpack/runtime/make namespace object"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(this, () => {\nreturn ","import { EventOptions} from './types'\nexport class App {\n\n _events: Object;\n\n public start;\n public h;\n public createElement;\n public render;\n public Fragment;\n public webComponent;\n public safeHTML;\n public use_render;\n public use_react;\n\n constructor() {\n this._events = {};\n }\n\n on(name: string, fn: (...args) => void, options: EventOptions = {}): void {\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn, options });\n }\n\n off(name: string, fn: (...args) => void): void {\n const subscribers = this._events[name] || [];\n\n this._events[name] = subscribers.filter((sub) => sub.fn !== fn);\n }\n\n find(name: string): any {\n return this._events[name];\n }\n\n run(name: string, ...args): number {\n const subscribers = this.getSubscribers(name, this._events);\n console.assert(subscribers && subscribers.length > 0, 'No subscriber for event: ' + name);\n subscribers.forEach((sub) => {\n const { fn, options } = sub;\n if (options.delay) {\n this.delay(name, fn, args, options);\n } else {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n return !sub.options.once;\n });\n\n return subscribers.length;\n }\n\n once(name: string, fn, options: EventOptions = {}): void {\n this.on(name, fn, { ...options, once: true });\n }\n\n private delay(name, fn, args, options): void {\n if (options._t) clearTimeout(options._t);\n options._t = setTimeout(() => {\n clearTimeout(options._t);\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }, options.delay);\n }\n\n runAsync(name: string, ...args): Promise<any[]> {\n const subscribers = this.getSubscribers(name, this._events);\n console.assert(subscribers && subscribers.length > 0, 'No subscriber for event: ' + name);\n const promises = subscribers.map(sub => {\n const { fn, options } = sub;\n return Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n });\n return Promise.all(promises);\n }\n\n query(name: string, ...args): Promise<any[]> {\n return this.runAsync(name, ...args);\n }\n\n private getSubscribers(name: string, events) {\n const subscribers = events[name] || [];\n\n // Update the list of subscribers by pulling out those which will run once.\n // We must do this update prior to running any of the events in case they\n // cause additional events to be turned off or on.\n events[name] = subscribers.filter((sub) => {\n return !sub.options.once;\n });\n Object.keys(events).filter(evt => evt.endsWith('*') && name.startsWith(evt.replace('*', '')))\n .sort((a, b) => b.length - a.length)\n .forEach(evt => subscribers.push(...events[evt].map(sub => ({\n ...sub,\n options: { ...sub.options, event: name }\n }))));\n return subscribers;\n }\n}\n\nconst AppRunVersions = 'AppRun-3';\nlet app: App;\nconst root = (typeof self === 'object' && self.self === self && self) ||\n (typeof global === 'object' && global.global === global && global)\nif (root['app'] && root['_AppRunVersions']) {\n app = root['app'];\n} else {\n app = new App();\n root['app'] = app;\n root['_AppRunVersions'] = AppRunVersions;\n}\nexport default app;\n","import app from './app';\n\nconst getStateValue = (component, name) => {\n return (name ? component['state'][name] : component['state']) || '';\n}\n\nconst setStateValue = (component, name, value) => {\n if (name) {\n const state = component['state'] || {};\n state[name] = value;\n component.setState(state);\n } else {\n component.setState(value);\n }\n}\n\nconst apply_directive = (key: string, props: {}, tag, component) => {\n if (key.startsWith('$on')) {\n const event = props[key];\n key = key.substring(1)\n if (typeof event === 'boolean') {\n props[key] = e => component.run ? component.run(key, e) : app.run(key, e);\n } else if (typeof event === 'string') {\n props[key] = e => component.run ? component.run(event, e) : app.run(event, e);\n } else if (typeof event === 'function') {\n props[key] = e => component.setState(event(component.state, e));\n } else if (Array.isArray(event)) {\n const [handler, ...p] = event;\n if (typeof handler === 'string') {\n props[key] = e => component.run ? component.run(handler, ...p, e) : app.run(handler, ...p, e);\n } else if (typeof handler === 'function') {\n props[key] = e => component.setState(handler(component.state, ...p, e));\n }\n }\n\n } else if (key === '$bind') {\n const type = props['type'] || 'text';\n const name = typeof props[key] === 'string' ? props[key] : props['name'];\n if (tag === 'input') {\n switch (type) {\n case 'checkbox':\n props['checked'] = getStateValue(component, name);\n props['onclick'] = e => setStateValue(component, name || e.target.name, e.target.checked);\n break;\n case 'radio':\n props['checked'] = getStateValue(component, name) === props['value'];\n props['onclick'] = e => setStateValue(component, name || e.target.name, e.target.value);\n break;\n case 'number':\n case 'range':\n props['value'] = getStateValue(component, name);\n props['oninput'] = e => setStateValue(component, name || e.target.name, Number(e.target.value));\n break;\n default:\n props['value'] = getStateValue(component, name);\n props['oninput'] = e => setStateValue(component, name || e.target.name, e.target.value);\n }\n } else if (tag === 'select') {\n props['value'] = getStateValue(component, name);\n props['onchange'] = e => {\n if (!e.target.multiple) { // multiple selection use $bind on option\n setStateValue(component, name || e.target.name, e.target.value);\n }\n }\n } else if (tag === 'option') {\n props['selected'] = getStateValue(component, name);\n props['onclick'] = e => setStateValue(component, name || e.target.name, e.target.selected);\n } else if (tag === 'textarea') {\n props['innerHTML'] = getStateValue(component, name);\n props['oninput'] = e => setStateValue(component, name || e.target.name, e.target.value);\n }\n } else {\n app.run('$', { key, tag, props, component });\n }\n}\n\nconst directive = (vdom, component) => {\n if (Array.isArray(vdom)) {\n return vdom.map(element => directive(element, component));\n } else {\n let { type, tag, props, children } = vdom;\n tag = tag || type;\n children = children || props?.children;\n if (props) Object.keys(props).forEach(key => {\n if (key.startsWith('$')) {\n apply_directive(key, props, tag, component);\n delete props[key];\n }\n });\n if (children) directive(children, component);\n return vdom;\n }\n}\n\nexport default directive;","import { VDOM, VNode } from './types';\nimport directive from './directive';\nexport type Element = any; //HTMLElement | SVGSVGElement | SVGElement;\n\nexport function Fragment(props, ...children): any[] {\n return collect(children);\n}\n\nconst ATTR_PROPS = '_props';\n\nfunction collect(children) {\n const ch = [];\n const push = (c) => {\n if (c !== null && c !== undefined && c !== '' && c !== false) {\n ch.push((typeof c === 'function' || typeof c === 'object') ? c : `${c}`);\n }\n }\n children && children.forEach(c => {\n if (Array.isArray(c)) {\n c.forEach(i => push(i));\n } else {\n push(c);\n }\n });\n return ch;\n}\n\nexport function createElement(tag: string | Function | [], props?: {}, ...children) {\n const ch = collect(children);\n if (typeof tag === 'string') return { tag, props, children: ch };\n else if (Array.isArray(tag)) return tag; // JSX fragments - babel\n else if (tag === undefined && children) return ch; // JSX fragments - typescript\n else if (Object.getPrototypeOf(tag).__isAppRunComponent) return { tag, props, children: ch } // createComponent(tag, { ...props, children });\n else if (typeof tag === 'function') return tag(props, ch);\n else throw new Error(`Unknown tag in vdom ${tag}`);\n};\n\nconst keyCache = new WeakMap();\n\nexport const updateElement = (element: Element | string, nodes: VDOM, component = {}) => {\n // tslint:disable-next-line\n if (nodes == null || nodes === false) return;\n const el = (typeof element === 'string' && element) ?\n document.getElementById(element) || document.querySelector(element) : element;\n nodes = directive(nodes, component);\n render(el, nodes, component);\n}\n\nfunction render(element: Element, nodes: VDOM, parent = {}) {\n // tslint:disable-next-line\n if (nodes == null || nodes === false) return;\n nodes = createComponent(nodes, parent);\n if (!element) return;\n const isSvg = element.nodeName === \"SVG\";\n if (Array.isArray(nodes)) {\n updateChildren(element, nodes, isSvg);\n } else {\n updateChildren(element, [nodes], isSvg);\n }\n}\n\nfunction same(el: Element, node: VNode) {\n // if (!el || !node) return false;\n const key1 = el.nodeName;\n const key2 = `${node.tag || ''}`;\n return key1.toUpperCase() === key2.toUpperCase();\n}\n\nfunction update(element: Element, node: VNode, isSvg: boolean) {\n if (node['_op'] === 3) return;\n // console.assert(!!element);\n isSvg = isSvg || node.tag === \"svg\";\n if (!same(element, node)) {\n element.parentNode.replaceChild(create(node, isSvg), element);\n return;\n }\n !(node['_op'] & 2) && updateChildren(element, node.children, isSvg);\n !(node['_op'] & 1) && updateProps(element, node.props, isSvg);\n}\n\nfunction updateChildren(element, children, isSvg: boolean) {\n const old_len = element.childNodes?.length || 0;\n const new_len = children?.length || 0;\n const len = Math.min(old_len, new_len);\n for (let i = 0; i < len; i++) {\n const child = children[i];\n if (child['_op'] === 3) continue;\n const el = element.childNodes[i];\n if (typeof child === 'string') {\n if (el.textContent !== child) {\n if (el.nodeType === 3) {\n el.nodeValue = child\n } else {\n element.replaceChild(createText(child), el);\n }\n }\n } else if (child instanceof HTMLElement || child instanceof SVGElement) {\n element.insertBefore(child, el);\n } else {\n const key = child.props && child.props['key'];\n if (key) {\n if (el.key === key) {\n update(element.childNodes[i], child, isSvg);\n } else {\n // console.log(el.key, key);\n const old = keyCache[key];\n if (old) {\n const temp = old.nextSibling;\n element.insertBefore(old, el);\n temp ? element.insertBefore(el, temp) : element.appendChild(el);\n update(element.childNodes[i], child, isSvg);\n } else {\n element.replaceChild(create(child, isSvg), el);\n }\n }\n } else {\n update(element.childNodes[i], child, isSvg);\n }\n }\n }\n\n let n = element.childNodes?.length || 0;\n while (n > len) {\n element.removeChild(element.lastChild);\n n--;\n }\n\n if (new_len > len) {\n const d = document.createDocumentFragment();\n for (let i = len; i < children.length; i++) {\n d.appendChild(create(children[i], isSvg));\n }\n element.appendChild(d);\n }\n}\n\nexport const safeHTML = (html: string) => {\n const div = document.createElement('section');\n div.insertAdjacentHTML('afterbegin', html)\n return Array.from(div.children);\n}\n\nfunction createText(node) {\n if (node?.indexOf('_html:') === 0) { // ?\n const div = document.createElement('div');\n div.insertAdjacentHTML('afterbegin', node.substring(6))\n return div;\n } else {\n return document.createTextNode(node??'');\n }\n}\n\nfunction create(node: VNode | string | HTMLElement | SVGElement, isSvg: boolean): Element {\n // console.assert(node !== null && node !== undefined);\n if ((node instanceof HTMLElement) || (node instanceof SVGElement)) return node;\n if (typeof node === \"string\") return createText(node);\n if (!node.tag || (typeof node.tag === 'function')) return createText(JSON.stringify(node));\n isSvg = isSvg || node.tag === \"svg\";\n const element = isSvg\n ? document.createElementNS(\"http://www.w3.org/2000/svg\", node.tag)\n : document.createElement(node.tag);\n\n updateProps(element, node.props, isSvg);\n if (node.children) node.children.forEach(child => element.appendChild(create(child, isSvg)));\n return element\n}\n\nfunction mergeProps(oldProps: {}, newProps: {}): {} {\n newProps['class'] = newProps['class'] || newProps['className'];\n delete newProps['className'];\n const props = {};\n if (oldProps) Object.keys(oldProps).forEach(p => props[p] = null);\n if (newProps) Object.keys(newProps).forEach(p => props[p] = newProps[p]);\n return props;\n}\n\nexport function updateProps(element: Element, props: {}, isSvg) {\n // console.assert(!!element);\n const cached = element[ATTR_PROPS] || {};\n props = mergeProps(cached, props || {});\n element[ATTR_PROPS] = props;\n\n for (const name in props) {\n const value = props[name];\n // if (cached[name] === value) continue;\n // console.log('updateProps', name, value);\n if (name.startsWith('data-')) {\n const dname = name.substring(5);\n const cname = dname.replace(/-(\\w)/g, (match) => match[1].toUpperCase());\n if (element.dataset[cname] !== value) {\n if (value || value === \"\") element.dataset[cname] = value;\n else delete element.dataset[cname];\n }\n } else if (name === 'style') {\n if (element.style.cssText) element.style.cssText = '';\n if (typeof value === 'string') element.style.cssText = value;\n else {\n for (const s in value) {\n if (element.style[s] !== value[s]) element.style[s] = value[s];\n }\n }\n } else if (name.startsWith('xlink')) {\n const xname = name.replace('xlink', '').toLowerCase();\n if (value == null || value === false) {\n element.removeAttributeNS('http://www.w3.org/1999/xlink', xname);\n } else {\n element.setAttributeNS('http://www.w3.org/1999/xlink', xname, value);\n }\n } else if (name.startsWith('on')) {\n if (!value || typeof value === 'function') {\n element[name] = value;\n } else if (typeof value === 'string') {\n if (value) element.setAttribute(name, value);\n else element.removeAttribute(name);\n }\n } else if (/^id$|^class$|^list$|^readonly$|^contenteditable$|^role|-|^for$/g.test(name) || isSvg) {\n if (element.getAttribute(name) !== value) {\n if (value) element.setAttribute(name, value);\n else element.removeAttribute(name);\n }\n } else if (element[name] !== value) {\n element[name] = value;\n }\n if (name === 'key' && value) keyCache[value] = element;\n }\n if (props && typeof props['ref'] === 'function') {\n window.requestAnimationFrame(() => props['ref'](element));\n }\n}\n\nfunction render_component(node, parent, idx) {\n const { tag, props, children } = node;\n let key = `_${idx}`;\n let id = props && props['id'];\n if (!id) id = `_${idx}${Date.now()}`;\n else key = id;\n let asTag = 'section';\n if (props && props['as']) {\n asTag = props['as'];\n delete props['as'];\n }\n if (!parent.__componentCache) parent.__componentCache = {};\n let component = parent.__componentCache[key];\n if (!component || !(component instanceof tag) || !component.element) {\n const element = document.createElement(asTag);\n component = parent.__componentCache[key] = new tag({ ...props, children }).mount(element, { render: true });\n } else {\n component.renderState(component.state);\n }\n if (component.mounted) {\n const new_state = component.mounted(props, children, component.state);\n (typeof new_state !== 'undefined') && component.setState(new_state);\n }\n updateProps(component.element, props, false);\n return component.element;\n}\n\nfunction createComponent(node, parent, idx = 0) {\n if (typeof node === 'string') return node;\n if (Array.isArray(node)) return node.map(child => createComponent(child, parent, idx++));\n let vdom = node;\n if (node && typeof node.tag === 'function' && Object.getPrototypeOf(node.tag).__isAppRunComponent) {\n vdom = render_component(node, parent, idx);\n }\n if (vdom && Array.isArray(vdom.children)) {\n const new_parent = vdom.props?._component;\n if (new_parent) {\n let i = 0;\n vdom.children = vdom.children.map(child => createComponent(child, new_parent, i++));\n } else {\n vdom.children = vdom.children.map(child => createComponent(child, parent, idx++));\n }\n }\n return vdom;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["root","factory","exports","module","define","amd","this","app","self","g","global","constructor","_events","on","name","fn","options","push","off","subscribers","filter","sub","find","run","args","getSubscribers","console","assert","length","forEach","delay","Object","keys","apply","once","_t","clearTimeout","setTimeout","runAsync","promises","map","Promise","all","query","events","evt","endsWith","startsWith","replace","sort","a","b","event","getStateValue","component","setStateValue","value","state","setState","directive","vdom","Array","isArray","element","type","tag","props","children","key","substring","e","handler","p","target","checked","Number","multiple","selected","apply_directive","Fragment","collect","ATTR_PROPS","ch","c","i","createElement","undefined","getPrototypeOf","__isAppRunComponent","Error","keyCache","WeakMap","updateElement","nodes","parent","createComponent","isSvg","nodeName","updateChildren","render","document","getElementById","querySelector","update","node","el","key1","key2","toUpperCase","same","updateProps","parentNode","replaceChild","create","old_len","childNodes","new_len","len","Math","min","child","textContent","nodeType","nodeValue","createText","HTMLElement","SVGElement","insertBefore","old","temp","nextSibling","appendChild","n","removeChild","lastChild","d","createDocumentFragment","safeHTML","html","div","insertAdjacentHTML","from","indexOf","createTextNode","JSON","stringify","createElementNS","cached","oldProps","newProps","mergeProps","cname","match","dataset","style","cssText","s","xname","toLowerCase","removeAttributeNS","setAttributeNS","setAttribute","removeAttribute","test","getAttribute","window","requestAnimationFrame","idx","id","Date","now","asTag","__componentCache","renderState","mount","mounted","new_state","render_component","new_parent","_component","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","definition","o","defineProperty","enumerable","get","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apprun",
3
- "version": "3.33.7",
3
+ "version": "3.33.9",
4
4
  "description": "JavaScript library that has Elm inspired architecture, event pub-sub and components",
5
5
  "main": "dist/apprun.js",
6
6
  "module": "esm/apprun.js",
@@ -38,24 +38,24 @@
38
38
  },
39
39
  "homepage": "https://github.com/yysun/apprun#readme",
40
40
  "devDependencies": {
41
- "@rollup/plugin-commonjs": "^21.0.3",
42
- "@rollup/plugin-node-resolve": "^13.1.3",
43
- "@types/jest": "^27.4.1",
41
+ "@rollup/plugin-commonjs": "^21.1.0",
42
+ "@rollup/plugin-node-resolve": "^13.3.0",
43
+ "@types/jest": "^27.5.2",
44
44
  "jest": "^27.5.1",
45
45
  "json-loader": "^0.5.7",
46
46
  "lit-html": "^2.8.0",
47
- "marked": "^11.0.1",
48
- "rollup": "^2.70.1",
49
- "rollup-plugin-filesize": "^9.1.2",
47
+ "marked": "^14.1.2",
48
+ "rollup": "^2.79.2",
49
+ "rollup-plugin-filesize": "^10.0.0",
50
50
  "rollup-plugin-node-resolve": "^5.2.0",
51
51
  "rollup-plugin-sourcemaps": "^0.6.3",
52
52
  "rollup-plugin-terser": "^7.0.2",
53
53
  "ts-jest": "^27.1.4",
54
54
  "ts-loader": "^9.5.1",
55
55
  "typescript": "^4.6.3",
56
- "webpack": "^5.89.0",
56
+ "webpack": "^5.95.0",
57
57
  "webpack-cli": "^5.1.4",
58
- "webpack-dev-server": "^4.15.1"
58
+ "webpack-dev-server": "^5.1.0"
59
59
  },
60
60
  "jest": {
61
61
  "testEnvironment": "jsdom",
@@ -83,6 +83,7 @@
83
83
  "testRunner": "jest-jasmine2"
84
84
  },
85
85
  "dependencies": {
86
+ "commander": "^12.1.0",
86
87
  "js-yaml": "^4.1.0"
87
88
  }
88
89
  }
package/react.js CHANGED
@@ -1,5 +1,20 @@
1
+ import app from 'apprun';
2
+ import React from 'react';
3
+ import ReactDOM from 'react-dom/client'
1
4
  import { useState } from 'react';
2
5
 
6
+ export const user_react = () => {
7
+ app.h = app.createElement = React.createElement;
8
+ app.Fragment = React.Fragment;
9
+ app.render = (el, vdom) => ReactDOM.render(vdom, el);
10
+ if (React.version && React.version.startsWith('18')) {
11
+ app.render = (el, vdom) => {
12
+ if (!el || !vdom) return;
13
+ if (!el._root) el._root = ReactDOM.createRoot(el);
14
+ el._root.render(vdom);
15
+ }
16
+ }
17
+ }
3
18
  const toReact = (componentClass) => {
4
19
  const component = new componentClass().mount();
5
20
  const { state, view } = component;
package/src/apprun.ts CHANGED
@@ -6,6 +6,13 @@ import { on, update, customElement } from './decorator';
6
6
  import webComponent, { CustomElementOptions } from './web-component';
7
7
  import { Route, route, ROUTER_EVENT, ROUTER_404_EVENT } from './router';
8
8
 
9
+ export type StatelessComponent<T = {}> = (args: T) => string | VNode | void;
10
+ export { App, app, Component, View, Action, Update, on, update, EventOptions, ActionOptions, MountOptions, Fragment, safeHTML }
11
+ export { update as event };
12
+ export { ROUTER_EVENT, ROUTER_404_EVENT };
13
+ export { customElement, CustomElementOptions, AppStartOptions };
14
+ export default app as IApp;
15
+
9
16
  export interface IApp {
10
17
  start<T, E = any>(element?: Element | string, model?: T, view?: View<T>, update?: Update<T, E>,
11
18
  options?: AppStartOptions<T>): Component<T, E>;
@@ -24,68 +31,64 @@ export interface IApp {
24
31
  use_react(createRoot);
25
32
  }
26
33
 
27
- app.h = app.createElement = createElement;
28
- app.render = render;
29
- app.Fragment = Fragment;
30
- app.webComponent = webComponent;
31
- app.safeHTML = safeHTML;
34
+ if (!app.start) {
35
+ app.h = app.createElement = createElement;
36
+ app.render = render;
37
+ app.Fragment = Fragment;
38
+ app.webComponent = webComponent;
39
+ app.safeHTML = safeHTML;
32
40
 
33
- app.start = <T, E = any>(element?: Element | string, model?: T, view?: View<T>, update?: Update<T, E>,
34
- options?: AppStartOptions<T>): Component<T, E> => {
35
- const opts = { render: true, global_event: true, ...options };
36
- const component = new Component<T, E>(model, view, update);
37
- if (options && options.rendered) component.rendered = options.rendered;
38
- if (options && options.mounted) component.mounted = options.mounted;
39
- component.start(element, opts);
40
- return component;
41
- };
41
+ app.start = <T, E = any>(element?: Element | string, model?: T, view?: View<T>, update?: Update<T, E>,
42
+ options?: AppStartOptions<T>): Component<T, E> => {
43
+ const opts = { render: true, global_event: true, ...options };
44
+ const component = new Component<T, E>(model, view, update);
45
+ if (options && options.rendered) component.rendered = options.rendered;
46
+ if (options && options.mounted) component.mounted = options.mounted;
47
+ component.start(element, opts);
48
+ return component;
49
+ };
42
50
 
43
- const NOOP = _ => {/* Intentionally empty */ }
44
- app.on('$', NOOP);
45
- app.on('debug', _ => NOOP);
46
- app.on(ROUTER_EVENT, NOOP);
47
- app.on('#', NOOP);
48
- app['route'] = route;
49
- app.on('route', url => app['route'] && app['route'](url));
51
+ const NOOP = _ => {/* Intentionally empty */ }
52
+ app.on('$', NOOP);
53
+ app.on('debug', _ => NOOP);
54
+ app.on(ROUTER_EVENT, NOOP);
55
+ app.on('#', NOOP);
56
+ app['route'] = route;
57
+ app.on('route', url => app['route'] && app['route'](url));
50
58
 
51
- if (typeof document === 'object') {
52
- document.addEventListener("DOMContentLoaded", () => {
53
- if (app['route'] === route) {
54
- window.onpopstate = () => route(location.hash);
55
- document.body.hasAttribute('apprun-no-init') || app['no-init-route'] || route(location.hash);
56
- }
57
- });
58
- }
59
- export type StatelessComponent<T = {}> = (args: T) => string | VNode | void;
60
- export { App, app, Component, View, Action, Update, on, update, EventOptions, ActionOptions, MountOptions, Fragment, safeHTML }
61
- export { update as event };
62
- export { ROUTER_EVENT, ROUTER_404_EVENT };
63
- export { customElement, CustomElementOptions, AppStartOptions };
64
- export default app as IApp;
59
+ if (typeof document === 'object') {
60
+ document.addEventListener("DOMContentLoaded", () => {
61
+ if (app['route'] === route) {
62
+ window.onpopstate = () => route(location.hash);
63
+ document.body.hasAttribute('apprun-no-init') || app['no-init-route'] || route(location.hash);
64
+ }
65
+ });
66
+ }
65
67
 
66
- if (typeof window === 'object') {
67
- window['Component'] = Component;
68
- window['_React'] = window['React'];
69
- window['React'] = app;
70
- window['on'] = on;
71
- window['customElement'] = customElement;
72
- window['safeHTML'] = safeHTML;
73
- }
68
+ if (typeof window === 'object') {
69
+ window['Component'] = Component;
70
+ window['_React'] = window['React'];
71
+ window['React'] = app;
72
+ window['on'] = on;
73
+ window['customElement'] = customElement;
74
+ window['safeHTML'] = safeHTML;
75
+ }
74
76
 
75
- app.use_render = (render, mode = 0) =>
76
- mode === 0 ?
77
- app.render = (el, vdom) => render(vdom, el) : // react style
78
- app.render = (el, vdom) => render(el, vdom); // apprun style
77
+ app.use_render = (render, mode = 0) =>
78
+ mode === 0 ?
79
+ app.render = (el, vdom) => render(vdom, el) : // react style
80
+ app.render = (el, vdom) => render(el, vdom); // apprun style
79
81
 
80
- app.use_react = (React, ReactDOM) => {
81
- app.h = app.createElement = React.createElement;
82
- app.Fragment = React.Fragment;
83
- app.render = (el, vdom) => ReactDOM.render(vdom, el);
84
- if (React.version && React.version.startsWith('18')) {
85
- app.render = (el, vdom) => {
86
- if (!el || !vdom) return;
87
- if (!el._root) el._root = ReactDOM.createRoot(el);
88
- el._root.render(vdom);
82
+ app.use_react = (React, ReactDOM) => {
83
+ app.h = app.createElement = React.createElement;
84
+ app.Fragment = React.Fragment;
85
+ app.render = (el, vdom) => ReactDOM.render(vdom, el);
86
+ if (React.version && React.version.startsWith('18')) {
87
+ app.render = (el, vdom) => {
88
+ if (!el || !vdom) return;
89
+ if (!el._root) el._root = ReactDOM.createRoot(el);
90
+ el._root.render(vdom);
91
+ }
89
92
  }
90
93
  }
91
94
  }
package/src/vdom.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createElement, updateElement, Fragment, safeHTML } from './vdom-my';
2
2
  export { createElement, Fragment, updateElement as render, safeHTML };
3
+ export { createElement as jsx, createElement as jsxs };
3
4
 
4
5
 
@@ -5,6 +5,7 @@ module.exports = {
5
5
  'dist/apprun': './src/apprun.ts',
6
6
  'dist/apprun-play': './src/apprun-play.tsx',
7
7
  'dist/apprun-html': './src/apprun-html.ts',
8
+ './jsx-runtime': './src/vdom.ts',
8
9
  'dist/apprun-dev-tools': './src/apprun-dev-tools.tsx',
9
10
  'demo/app': './demo/main.ts'
10
11
  },