solid-ui 2.4.28-6587e612 → 2.4.28-69262fe5

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.
Files changed (79) hide show
  1. package/dist/805.solid-ui.min.js +1 -1
  2. package/dist/805.solid-ui.min.js.map +1 -1
  3. package/dist/solid-ui.js +1342 -2103
  4. package/dist/solid-ui.js.map +1 -1
  5. package/dist/solid-ui.min.js +1 -1
  6. package/dist/solid-ui.min.js.map +1 -1
  7. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +1955 -1955
  8. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -1
  9. package/lib/chat/bookmarks.js +7 -6
  10. package/lib/chat/bookmarks.js.map +1 -1
  11. package/lib/chat/chatLogic.js +65 -249
  12. package/lib/chat/chatLogic.js.map +1 -1
  13. package/lib/chat/dateFolder.js +126 -129
  14. package/lib/chat/dateFolder.js.map +1 -1
  15. package/lib/chat/infinite.js +423 -637
  16. package/lib/chat/infinite.js.map +1 -1
  17. package/lib/chat/message.js +193 -332
  18. package/lib/chat/message.js.map +1 -1
  19. package/lib/chat/messageTools.js +277 -463
  20. package/lib/chat/messageTools.js.map +1 -1
  21. package/lib/chat/thread.js +145 -168
  22. package/lib/chat/thread.js.map +1 -1
  23. package/lib/header/index.js +0 -5
  24. package/lib/header/index.js.map +1 -1
  25. package/lib/log.js +5 -5
  26. package/lib/log.js.map +1 -1
  27. package/lib/login/login.d.ts.map +1 -1
  28. package/lib/login/login.js +31 -65
  29. package/lib/login/login.js.map +1 -1
  30. package/lib/media/media-capture.d.ts +2 -2
  31. package/lib/media/media-capture.d.ts.map +1 -1
  32. package/lib/media/media-capture.js +11 -15
  33. package/lib/media/media-capture.js.map +1 -1
  34. package/lib/pad.d.ts +2 -2
  35. package/lib/pad.d.ts.map +1 -1
  36. package/lib/pad.js +15 -41
  37. package/lib/pad.js.map +1 -1
  38. package/lib/participation.d.ts +5 -5
  39. package/lib/participation.d.ts.map +1 -1
  40. package/lib/participation.js +22 -23
  41. package/lib/participation.js.map +1 -1
  42. package/lib/preferences.js +0 -4
  43. package/lib/preferences.js.map +1 -1
  44. package/lib/style.js +35 -28
  45. package/lib/style.js.map +1 -1
  46. package/lib/styleConstants.js +34 -0
  47. package/lib/styleConstants.js.map +1 -0
  48. package/lib/tabs.d.ts +0 -125
  49. package/lib/tabs.d.ts.map +1 -1
  50. package/lib/tabs.js +15 -8
  51. package/lib/tabs.js.map +1 -1
  52. package/lib/utils/headerFooterHelpers.js +0 -2
  53. package/lib/utils/headerFooterHelpers.js.map +1 -1
  54. package/lib/versionInfo.js +6 -6
  55. package/lib/versionInfo.js.map +1 -1
  56. package/lib/widgets/buttons.js +2 -0
  57. package/lib/widgets/buttons.js.map +1 -1
  58. package/lib/widgets/dragAndDrop.js +10 -18
  59. package/lib/widgets/dragAndDrop.js.map +1 -1
  60. package/lib/widgets/error.d.ts.map +1 -1
  61. package/lib/widgets/error.js +9 -2
  62. package/lib/widgets/error.js.map +1 -1
  63. package/lib/widgets/forms/autocomplete/autocompleteBar.js +1 -8
  64. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  65. package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +1 -1
  66. package/lib/widgets/forms/autocomplete/autocompletePicker.js +5 -9
  67. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  68. package/lib/widgets/forms/autocomplete/language.js +0 -5
  69. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  70. package/lib/widgets/forms/basic.d.ts.map +1 -1
  71. package/lib/widgets/forms/basic.js +4 -3
  72. package/lib/widgets/forms/basic.js.map +1 -1
  73. package/lib/widgets/forms/fieldParams.js +2 -2
  74. package/lib/widgets/forms/fieldParams.js.map +1 -1
  75. package/lib/widgets/forms.js +10 -12
  76. package/lib/widgets/forms.js.map +1 -1
  77. package/lib/widgets/peoplePicker.js +0 -11
  78. package/lib/widgets/peoplePicker.js.map +1 -1
  79. package/package.json +2 -3
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
@@ -12,6 +13,7 @@ var _rdflib = require("rdflib");
12
13
  var _solidLogic = require("solid-logic");
13
14
  var ns = _interopRequireWildcard(require("../../ns"));
14
15
  var _style = require("../../style");
16
+ var _styleConstants = _interopRequireDefault(require("../../styleConstants"));
15
17
  var _utils = require("../../utils");
16
18
  var _error = require("../error");
17
19
  var _fieldFunction = require("./fieldFunction");
@@ -27,7 +29,7 @@ function renderNameValuePair(dom, kb, box, form, label) {
27
29
  box.style.display = 'flex';
28
30
  box.style.flexDirection = 'row';
29
31
  var lhs = box.appendChild(dom.createElement('div'));
30
- lhs.style.width = _style.formFieldNameBoxWidth;
32
+ lhs.style.width = _styleConstants["default"].formFieldNameBoxWidth;
31
33
  var rhs = box.appendChild(dom.createElement('div'));
32
34
  lhs.setAttribute('class', 'formFieldName');
33
35
  lhs.setAttribute('style', _style.formFieldNameBoxStyle);
@@ -132,7 +134,7 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
132
134
  field.style = style;
133
135
  rhs.appendChild(field);
134
136
  field.setAttribute('type', params.type ? params.type : 'text');
135
- var size = kb.anyJS(form, ns.ui('size')) || _style.textInputSize || 20;
137
+ var size = kb.anyJS(form, ns.ui('size')) || _styleConstants["default"].textInputSize || 20;
136
138
  field.setAttribute('size', size);
137
139
  var maxLength = kb.any(form, ns.ui('maxLength'));
138
140
  field.setAttribute('maxLength', maxLength ? '' + maxLength : '4096');
@@ -157,7 +159,6 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
157
159
  field.readOnly = true // was: disabled. readOnly is better
158
160
  ;
159
161
  field.style = _style.textInputStyleUneditable + paramStyle;
160
- // backgroundColor = textInputBackgroundColorUneditable
161
162
  if (suppressEmptyUneditable && field.value === '') {
162
163
  box.style.display = 'none'; // clutter
163
164
  }
@@ -1 +1 @@
1
- {"version":3,"file":"basic.js","names":["_rdflib","require","_solidLogic","ns","_interopRequireWildcard","_style","_utils","_error","_fieldFunction","_fieldParams","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","store","solidLogicSingleton","renderNameValuePair","dom","kb","box","form","label","style","display","flexDirection","lhs","appendChild","createElement","width","formFieldNameBoxWidth","rhs","setAttribute","formFieldNameBoxStyle","createTextNode","any","ui","fieldLabel","errorMessageBlock","property","fieldInQuestion","lab","undefined","anchor","uri","textContent","fieldStore","subject","predicate","def","sts","statementsMatching","length","updater","Error","why","value","editable","sym","basicField","container","already","doc","callbackFunction","formDoc","suppressEmptyUneditable","anyJS","mostSpecificClassURI","params","fieldParams","paramStyle","textInputStyle","field","type","size","textInputSize","maxLength","uriPrefix","decodeURIComponent","replace","readOnly","textInputStyleUneditable","addEventListener","_e","pattern","match","disabled","ds","result","namedNode","encodeURIComponent","dt","Literal","trim","xsd","is","map","statement","st","updateMany","callback","docs","forEach","includes","push","update","pop","is1","filter","is2","ds1","ds2","ok","body"],"sources":["../../../src/widgets/forms/basic.ts"],"sourcesContent":["import { BlankNode, Literal, NamedNode, Node, st, Store, Variable } from 'rdflib'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { formFieldNameBoxStyle, formFieldNameBoxWidth, textInputSize, textInputStyle, textInputStyleUneditable } from '../../style'\nimport { label } from '../../utils'\nimport { errorMessageBlock } from '../error'\nimport { mostSpecificClassURI } from './fieldFunction'\nimport { fieldParams } from './fieldParams'\n\nconst store = solidLogicSingleton.store\n\n/* Style and create a name, value pair\n*/\nexport function renderNameValuePair (dom: HTMLDocument, kb: Store, box: HTMLElement, form: NamedNode, label?: string):HTMLElement {\n // const property = kb.any(form, ns.ui('property'))\n box.style.display = 'flex'\n box.style.flexDirection = 'row'\n const lhs = box.appendChild(dom.createElement('div'))\n lhs.style.width = formFieldNameBoxWidth\n const rhs = box.appendChild(dom.createElement('div'))\n\n lhs.setAttribute('class', 'formFieldName')\n lhs.setAttribute('style', formFieldNameBoxStyle)\n rhs.setAttribute('class', 'formFieldValue')\n if (label) {\n lhs.appendChild(dom.createTextNode(label))\n } else if (kb.any(form, ns.ui('property'))) { // Assume more space for error on right\n lhs.appendChild(fieldLabel(dom, kb.any(form, ns.ui('property')) as NamedNode, form))\n } else {\n rhs.appendChild(errorMessageBlock(dom, 'No property or label given for form field: ' + form))\n lhs.appendChild(dom.createTextNode('???'))\n }\n return rhs\n}\n\n/**\n * Create an anchor element with a label as the anchor text.\n *\n * @param dom The DOM\n * @param property href for the anchor element\n * @param fieldInQuestion field to produce a label for\n *\n * @internal exporting this only for unit tests\n */\nexport function fieldLabel (dom: HTMLDocument, property: NamedNode | undefined, fieldInQuestion: Node): HTMLElement | Text {\n let lab = store.any(fieldInQuestion as any, ns.ui('label'))\n if (!lab) lab = label(property, true) // Init capital\n if (property === undefined) {\n return dom.createTextNode('@@Internal error: undefined property')\n }\n const anchor = dom.createElement('a')\n /* istanbul ignore next */\n if (property.uri) anchor.setAttribute('href', property.uri)\n anchor.setAttribute('style', 'color: #3B5998; text-decoration: none;') // Not too blue and no underline\n anchor.textContent = lab as any\n return anchor\n}\n\n/**\n * Returns the document for the first quad that matches\n * the subject and predicate provided, or default if that\n * store is not editable.\n *\n * @param subject Subject about which we want to find an editable RDF document\n * @param predicate Predicate about which we want to find an editable RDF document\n * @param def default RDF document to return if none found\n *\n * @internal exporting this only for unit tests\n */\nexport function fieldStore (subject: NamedNode | BlankNode | Variable, predicate: NamedNode | Variable, def: NamedNode | undefined): NamedNode | undefined {\n const sts = store.statementsMatching(subject, predicate)\n if (sts.length === 0) return def // can used default as no data yet\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n if (\n sts.length > 0 &&\n sts[0].why.value &&\n store.updater.editable(sts[0].why.value, store)\n ) {\n return store.sym(sts[0].why.value)\n }\n return def\n}\n\n/**\n * Render a basic form field\n *\n * The same function is used for many similar one-value fields, with different\n * regexps used to validate.\n *\n * @param dom The HTML Document object aka Document Object Model\n * @param container If present, the created widget will be appended to this\n * @param already A hash table of (form, subject) kept to prevent recursive forms looping\n * @param subject The thing about which the form displays/edits data\n * @param form The form or field to be rendered\n * @param doc The web document in which the data is\n * @param callbackFunction Called when data is changed?\n *\n * @returns The HTML widget created\n */\n// eslint-disable-next-line complexity\nexport function basicField (\n dom: HTMLDocument,\n container: HTMLElement | undefined,\n already,\n subject: NamedNode | BlankNode | Variable,\n form: NamedNode,\n doc: NamedNode | undefined,\n callbackFunction: (_ok: boolean, _errorMessage: string) => void\n): HTMLElement {\n const kb = store\n const formDoc = form.doc ? form.doc() : null // @@ if blank no way to know\n\n const box = dom.createElement('div')\n\n const property = kb.any(form, ns.ui('property'))\n if (container) container.appendChild(box)\n if (!property) {\n return box.appendChild(\n errorMessageBlock(dom, 'Error: No property given for text field: ' + form)\n )\n }\n const rhs = renderNameValuePair(dom, kb, box, form)\n\n // It can be cleaner to just remove empty fields if you can't edit them anyway\n const suppressEmptyUneditable = kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc)\n\n const uri = mostSpecificClassURI(form)\n let params = fieldParams[uri]\n if (params === undefined) params = { style: '' } // non-bottom field types can do this\n const paramStyle = params.style || ''\n const style = textInputStyle + paramStyle\n const field = dom.createElement('input')\n ;(field as any).style = style\n rhs.appendChild(field)\n field.setAttribute('type', params.type ? params.type : 'text')\n\n const size = kb.anyJS(form, ns.ui('size')) || textInputSize || 20\n field.setAttribute('size', size)\n\n const maxLength = kb.any(form, ns.ui('maxLength'))\n field.setAttribute('maxLength', maxLength ? '' + maxLength : '4096')\n\n doc = doc || fieldStore(subject, property as any, doc)\n\n let obj = kb.any(subject, property as any, undefined, doc)\n if (!obj) {\n obj = kb.any(form, ns.ui('default'))\n }\n if (obj && obj.value && params.uriPrefix) {\n // eg tel: or mailto:\n field.value = decodeURIComponent(obj.value.replace(params.uriPrefix, '')) // should have no spaces but in case\n .replace(/ /g, '')\n } else if (obj) {\n /* istanbul ignore next */\n field.value = obj.value || obj.value || ''\n }\n field.setAttribute('style', style)\n if (!kb.updater) {\n throw new Error('kb has no updater')\n }\n if (!kb.updater.editable((doc as NamedNode).uri)) {\n field.readOnly = true // was: disabled. readOnly is better\n ;(field as any).style = textInputStyleUneditable + paramStyle\n // backgroundColor = textInputBackgroundColorUneditable\n if (suppressEmptyUneditable && field.value === '') {\n box.style.display = 'none' // clutter\n }\n return box\n }\n\n // read-write:\n field.addEventListener(\n 'keyup',\n function (_e) {\n if (params.pattern) {\n field.setAttribute(\n 'style',\n style +\n (field.value.match(params.pattern)\n ? 'color: green;'\n : 'color: red;')\n )\n }\n },\n true\n )\n field.addEventListener(\n 'change',\n function (_e) {\n // i.e. lose focus with changed data\n if (params.pattern && !field.value.match(params.pattern)) return\n field.disabled = true // See if this stops getting two dates from fumbling e.g the chrome datepicker.\n field.setAttribute('style', style + 'color: gray;') // pending\n const ds = kb.statementsMatching(subject, property as any) // remove any multiple values\n let result\n if (params.namedNode) {\n result = kb.sym(field.value)\n } else if (params.uriPrefix) {\n result = encodeURIComponent(field.value.replace(/ /g, ''))\n result = kb.sym(params.uriPrefix + field.value)\n } else {\n if (params.dt) {\n result = new Literal(\n field.value.trim(),\n undefined,\n ns.xsd(params.dt)\n )\n } else {\n result = new Literal(field.value)\n }\n }\n let is = ds.map(statement => st(statement.subject, statement.predicate, result, statement.why)) // can include >1 doc\n if (is.length === 0) {\n // or none\n is = [st(subject, property as any, result, doc)]\n }\n\n function updateMany (ds, is: { why: { uri: string } }[], callback) {\n const docs: any[] = []\n is.forEach(st => {\n if (!docs.includes(st.why.uri)) docs.push(st.why.uri)\n })\n ds.forEach(st => {\n /* istanbul ignore next */\n if (!docs.includes(st.why.uri)) docs.push(st.why.uri)\n })\n /* istanbul ignore next */\n if (docs.length === 0) {\n throw new Error('updateMany has no docs to patch')\n }\n if (!kb.updater) {\n throw new Error('kb has no updater')\n }\n if (docs.length === 1) {\n return kb.updater.update(ds, is as any, callback)\n }\n // return kb.updater.update(ds, is, callback)\n\n const doc = docs.pop()\n const is1 = is.filter(st => st.why.uri === doc)\n const is2 = is.filter(st => st.why.uri !== doc)\n const ds1 = ds.filter(st => st.why.uri === doc)\n const ds2 = ds.filter(st => st.why.uri !== doc)\n kb.updater.update(ds1, is1 as any, function (uri, ok, body) {\n if (ok) {\n updateMany(ds2, is2, callback)\n } else {\n callback(uri, ok, body)\n }\n })\n }\n\n updateMany(ds, is as any, function (uri, ok, body) {\n // kb.updater.update(ds, is, function (uri, ok, body) {\n if (ok) {\n field.disabled = false\n field.setAttribute('style', style)\n } else {\n box.appendChild(errorMessageBlock(dom, body))\n }\n callbackFunction(ok, body)\n })\n },\n true\n )\n return box\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAA2C,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAA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C,IAAMiD,GAAG,GAAGxB,EAAE,CAACqB,MAAM,CAAC,UAAAV,EAAE;QAAA,OAAIA,EAAE,CAAC3C,GAAG,CAACX,GAAG,KAAKkB,GAAG;MAAA,EAAC;MAC/C3C,EAAE,CAACkC,OAAO,CAACoD,MAAM,CAACK,GAAG,EAAEH,GAAG,EAAS,UAAU/D,GAAG,EAAEoE,EAAE,EAAEC,IAAI,EAAE;QAC1D,IAAID,EAAE,EAAE;UACNb,UAAU,CAACY,GAAG,EAAEF,GAAG,EAAET,QAAQ,CAAC;QAChC,CAAC,MAAM;UACLA,QAAQ,CAACxD,GAAG,EAAEoE,EAAE,EAAEC,IAAI,CAAC;QACzB;MACF,CAAC,CAAC;IACJ;IAEAd,UAAU,CAACZ,EAAE,EAAEQ,EAAE,EAAS,UAAUnD,GAAG,EAAEoE,EAAE,EAAEC,IAAI,EAAE;MACjD;MACA,IAAID,EAAE,EAAE;QACNxC,KAAK,CAACc,QAAQ,GAAG,KAAK;QACtBd,KAAK,CAACxC,YAAY,CAAC,OAAO,EAAET,KAAK,CAAC;MACpC,CAAC,MAAM;QACLH,GAAG,CAACO,WAAW,CAAC,IAAAW,wBAAiB,EAACpB,GAAG,EAAE+F,IAAI,CAAC,CAAC;MAC/C;MACAlD,gBAAgB,CAACiD,EAAE,EAAEC,IAAI,CAAC;IAC5B,CAAC,CAAC;EACJ,CAAC,EACD,IAAI,CACL;EACD,OAAO7F,GAAG;AACZ"}
1
+ {"version":3,"file":"basic.js","names":["_rdflib","require","_solidLogic","ns","_interopRequireWildcard","_style","_styleConstants","_interopRequireDefault","_utils","_error","_fieldFunction","_fieldParams","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","store","solidLogicSingleton","renderNameValuePair","dom","kb","box","form","label","style","display","flexDirection","lhs","appendChild","createElement","width","styleConstants","formFieldNameBoxWidth","rhs","setAttribute","formFieldNameBoxStyle","createTextNode","any","ui","fieldLabel","errorMessageBlock","property","fieldInQuestion","lab","undefined","anchor","uri","textContent","fieldStore","subject","predicate","def","sts","statementsMatching","length","updater","Error","why","value","editable","sym","basicField","container","already","doc","callbackFunction","formDoc","suppressEmptyUneditable","anyJS","mostSpecificClassURI","params","fieldParams","paramStyle","textInputStyle","field","type","size","textInputSize","maxLength","uriPrefix","decodeURIComponent","replace","readOnly","textInputStyleUneditable","addEventListener","_e","pattern","match","disabled","ds","result","namedNode","encodeURIComponent","dt","Literal","trim","xsd","is","map","statement","st","updateMany","callback","docs","forEach","includes","push","update","pop","is1","filter","is2","ds1","ds2","ok","body"],"sources":["../../../src/widgets/forms/basic.ts"],"sourcesContent":["import { BlankNode, Literal, NamedNode, Node, st, Store, Variable } from 'rdflib'\nimport { solidLogicSingleton } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { formFieldNameBoxStyle, textInputStyle, textInputStyleUneditable } from '../../style'\nimport styleConstants from '../../styleConstants'\nimport { label } from '../../utils'\nimport { errorMessageBlock } from '../error'\nimport { mostSpecificClassURI } from './fieldFunction'\nimport { fieldParams } from './fieldParams'\n\nconst store = solidLogicSingleton.store\n\n/* Style and create a name, value pair\n*/\nexport function renderNameValuePair (dom: HTMLDocument, kb: Store, box: HTMLElement, form: NamedNode, label?: string):HTMLElement {\n // const property = kb.any(form, ns.ui('property'))\n box.style.display = 'flex'\n box.style.flexDirection = 'row'\n const lhs = box.appendChild(dom.createElement('div'))\n lhs.style.width = styleConstants.formFieldNameBoxWidth\n const rhs = box.appendChild(dom.createElement('div'))\n\n lhs.setAttribute('class', 'formFieldName')\n lhs.setAttribute('style', formFieldNameBoxStyle)\n rhs.setAttribute('class', 'formFieldValue')\n if (label) {\n lhs.appendChild(dom.createTextNode(label))\n } else if (kb.any(form, ns.ui('property'))) { // Assume more space for error on right\n lhs.appendChild(fieldLabel(dom, kb.any(form, ns.ui('property')) as NamedNode, form))\n } else {\n rhs.appendChild(errorMessageBlock(dom, 'No property or label given for form field: ' + form))\n lhs.appendChild(dom.createTextNode('???'))\n }\n return rhs\n}\n\n/**\n * Create an anchor element with a label as the anchor text.\n *\n * @param dom The DOM\n * @param property href for the anchor element\n * @param fieldInQuestion field to produce a label for\n *\n * @internal exporting this only for unit tests\n */\nexport function fieldLabel (dom: HTMLDocument, property: NamedNode | undefined, fieldInQuestion: Node): HTMLElement | Text {\n let lab = store.any(fieldInQuestion as any, ns.ui('label'))\n if (!lab) lab = label(property, true) // Init capital\n if (property === undefined) {\n return dom.createTextNode('@@Internal error: undefined property')\n }\n const anchor = dom.createElement('a')\n /* istanbul ignore next */\n if (property.uri) anchor.setAttribute('href', property.uri)\n anchor.setAttribute('style', 'color: #3B5998; text-decoration: none;') // Not too blue and no underline\n anchor.textContent = lab as any\n return anchor\n}\n\n/**\n * Returns the document for the first quad that matches\n * the subject and predicate provided, or default if that\n * store is not editable.\n *\n * @param subject Subject about which we want to find an editable RDF document\n * @param predicate Predicate about which we want to find an editable RDF document\n * @param def default RDF document to return if none found\n *\n * @internal exporting this only for unit tests\n */\nexport function fieldStore (subject: NamedNode | BlankNode | Variable, predicate: NamedNode | Variable, def: NamedNode | undefined): NamedNode | undefined {\n const sts = store.statementsMatching(subject, predicate)\n if (sts.length === 0) return def // can used default as no data yet\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n if (\n sts.length > 0 &&\n sts[0].why.value &&\n store.updater.editable(sts[0].why.value, store)\n ) {\n return store.sym(sts[0].why.value)\n }\n return def\n}\n\n/**\n * Render a basic form field\n *\n * The same function is used for many similar one-value fields, with different\n * regexps used to validate.\n *\n * @param dom The HTML Document object aka Document Object Model\n * @param container If present, the created widget will be appended to this\n * @param already A hash table of (form, subject) kept to prevent recursive forms looping\n * @param subject The thing about which the form displays/edits data\n * @param form The form or field to be rendered\n * @param doc The web document in which the data is\n * @param callbackFunction Called when data is changed?\n *\n * @returns The HTML widget created\n */\n// eslint-disable-next-line complexity\nexport function basicField (\n dom: HTMLDocument,\n container: HTMLElement | undefined,\n already,\n subject: NamedNode | BlankNode | Variable,\n form: NamedNode,\n doc: NamedNode | undefined,\n callbackFunction: (_ok: boolean, _errorMessage: string) => void\n): HTMLElement {\n const kb = store\n const formDoc = form.doc ? form.doc() : null // @@ if blank no way to know\n\n const box = dom.createElement('div')\n\n const property = kb.any(form, ns.ui('property'))\n if (container) container.appendChild(box)\n if (!property) {\n return box.appendChild(\n errorMessageBlock(dom, 'Error: No property given for text field: ' + form)\n )\n }\n const rhs = renderNameValuePair(dom, kb, box, form)\n\n // It can be cleaner to just remove empty fields if you can't edit them anyway\n const suppressEmptyUneditable = kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc)\n\n const uri = mostSpecificClassURI(form)\n let params = fieldParams[uri]\n if (params === undefined) params = { style: '' } // non-bottom field types can do this\n const paramStyle = params.style || ''\n const style = textInputStyle + paramStyle\n const field = dom.createElement('input')\n ;(field as any).style = style\n rhs.appendChild(field)\n field.setAttribute('type', params.type ? params.type : 'text')\n\n const size = kb.anyJS(form, ns.ui('size')) || styleConstants.textInputSize || 20\n field.setAttribute('size', size)\n\n const maxLength = kb.any(form, ns.ui('maxLength'))\n field.setAttribute('maxLength', maxLength ? '' + maxLength : '4096')\n\n doc = doc || fieldStore(subject, property as any, doc)\n\n let obj = kb.any(subject, property as any, undefined, doc)\n if (!obj) {\n obj = kb.any(form, ns.ui('default'))\n }\n if (obj && obj.value && params.uriPrefix) {\n // eg tel: or mailto:\n field.value = decodeURIComponent(obj.value.replace(params.uriPrefix, '')) // should have no spaces but in case\n .replace(/ /g, '')\n } else if (obj) {\n /* istanbul ignore next */\n field.value = obj.value || obj.value || ''\n }\n field.setAttribute('style', style)\n if (!kb.updater) {\n throw new Error('kb has no updater')\n }\n if (!kb.updater.editable((doc as NamedNode).uri)) {\n field.readOnly = true // was: disabled. readOnly is better\n ;(field as any).style = textInputStyleUneditable + paramStyle\n if (suppressEmptyUneditable && field.value === '') {\n box.style.display = 'none' // clutter\n }\n return box\n }\n\n // read-write:\n field.addEventListener(\n 'keyup',\n function (_e) {\n if (params.pattern) {\n field.setAttribute(\n 'style',\n style +\n (field.value.match(params.pattern)\n ? 'color: green;'\n : 'color: red;')\n )\n }\n },\n true\n )\n field.addEventListener(\n 'change',\n function (_e) {\n // i.e. lose focus with changed data\n if (params.pattern && !field.value.match(params.pattern)) return\n field.disabled = true // See if this stops getting two dates from fumbling e.g the chrome datepicker.\n field.setAttribute('style', style + 'color: gray;') // pending\n const ds = kb.statementsMatching(subject, property as any) // remove any multiple values\n let result\n if (params.namedNode) {\n result = kb.sym(field.value)\n } else if (params.uriPrefix) {\n result = encodeURIComponent(field.value.replace(/ /g, ''))\n result = kb.sym(params.uriPrefix + field.value)\n } else {\n if (params.dt) {\n result = new Literal(\n field.value.trim(),\n undefined,\n ns.xsd(params.dt)\n )\n } else {\n result = new Literal(field.value)\n }\n }\n let is = ds.map(statement => st(statement.subject, statement.predicate, result, statement.why)) // can include >1 doc\n if (is.length === 0) {\n // or none\n is = [st(subject, property as any, result, doc)]\n }\n\n function updateMany (ds, is: { why: { uri: string } }[], callback) {\n const docs: any[] = []\n is.forEach(st => {\n if (!docs.includes(st.why.uri)) docs.push(st.why.uri)\n })\n ds.forEach(st => {\n /* istanbul ignore next */\n if (!docs.includes(st.why.uri)) docs.push(st.why.uri)\n })\n /* istanbul ignore next */\n if (docs.length === 0) {\n throw new Error('updateMany has no docs to patch')\n }\n if (!kb.updater) {\n throw new Error('kb has no updater')\n }\n if (docs.length === 1) {\n return kb.updater.update(ds, is as any, callback)\n }\n // return kb.updater.update(ds, is, callback)\n\n const doc = docs.pop()\n const is1 = is.filter(st => st.why.uri === doc)\n const is2 = is.filter(st => st.why.uri !== doc)\n const ds1 = ds.filter(st => st.why.uri === doc)\n const ds2 = ds.filter(st => st.why.uri !== doc)\n kb.updater.update(ds1, is1 as any, function (uri, ok, body) {\n if (ok) {\n updateMany(ds2, is2, callback)\n } else {\n callback(uri, ok, body)\n }\n })\n }\n\n updateMany(ds, is as any, function (uri, ok, body) {\n // kb.updater.update(ds, is, function (uri, ok, body) {\n if (ok) {\n field.disabled = false\n field.setAttribute('style', style)\n } else {\n box.appendChild(errorMessageBlock(dom, body))\n }\n callbackFunction(ok, body)\n })\n },\n true\n )\n return box\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AAA2C,SAAAW,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA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AAQ,CAAC;QAChC,CAAC,MAAM;UACLA,QAAQ,CAACxD,GAAG,EAAEoE,EAAE,EAAEC,IAAI,CAAC;QACzB;MACF,CAAC,CAAC;IACJ;IAEAd,UAAU,CAACZ,EAAE,EAAEQ,EAAE,EAAS,UAAUnD,GAAG,EAAEoE,EAAE,EAAEC,IAAI,EAAE;MACjD;MACA,IAAID,EAAE,EAAE;QACNxC,KAAK,CAACc,QAAQ,GAAG,KAAK;QACtBd,KAAK,CAACxC,YAAY,CAAC,OAAO,EAAEV,KAAK,CAAC;MACpC,CAAC,MAAM;QACLH,GAAG,CAACO,WAAW,CAAC,IAAAY,wBAAiB,EAACrB,GAAG,EAAEgG,IAAI,CAAC,CAAC;MAC/C;MACAlD,gBAAgB,CAACiD,EAAE,EAAEC,IAAI,CAAC;IAC5B,CAAC,CAAC;EACJ,CAAC,EACD,IAAI,CACL;EACD,OAAO9F,GAAG;AACZ"}
@@ -70,10 +70,10 @@ var fieldParams = (_fieldParams = {}, (0, _defineProperty2["default"])(_fieldPar
70
70
  style: _style.formGroupStyle
71
71
  }), (0, _defineProperty2["default"])(_fieldParams, ns.ui('Comment').uri, {
72
72
  element: 'p',
73
- style: _style.commentStyle // was `padding: 0.1em 1.5em; color: ${formHeadingColor}; white-space: pre-wrap;`
73
+ style: _style.commentStyle
74
74
  }), (0, _defineProperty2["default"])(_fieldParams, ns.ui('Heading').uri, {
75
75
  element: 'h3',
76
- style: _style.formHeadingStyle // was: `font-size: 110%; font-weight: bold; color: ${formHeadingColor}; padding: 0.2em;`
76
+ style: _style.formHeadingStyle
77
77
  }), _fieldParams);
78
78
  exports.fieldParams = fieldParams;
79
79
  //# sourceMappingURL=fieldParams.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fieldParams.js","names":["ns","_interopRequireWildcard","require","_style","_fieldParams","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","fieldParams","_defineProperty2","ui","uri","size","type","style","dt","pattern","namedNode","uriPrefix","formGroupStyle","element","commentStyle","formHeadingStyle","exports"],"sources":["../../../src/widgets/forms/fieldParams.ts"],"sourcesContent":["import * as ns from '../../ns'\nimport { commentStyle, formHeadingStyle, formGroupStyle } from '../../style'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: string, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n uriPrefix?: string, // e.g. 'mailto:', will be removed when displaying value to user. Overrides dt.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and uriPrefix.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n uriPrefix: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n uriPrefix: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: commentStyle // was `padding: 0.1em 1.5em; color: ${formHeadingColor}; white-space: pre-wrap;`\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: formHeadingStyle // was: `font-size: 110%; font-weight: bold; color: ${formHeadingColor}; padding: 0.2em;`\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA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C,GAAG,EAAG;EACtBS,OAAO,EAAE,IAAI;EACbN,KAAK,EAAEQ,uBAAgB,CAAC;AAC1B,CAAC,GAAArC,YAAA,CACF;AAAAsC,OAAA,CAAAf,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"file":"fieldParams.js","names":["ns","_interopRequireWildcard","require","_style","_fieldParams","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","fieldParams","_defineProperty2","ui","uri","size","type","style","dt","pattern","namedNode","uriPrefix","formGroupStyle","element","commentStyle","formHeadingStyle","exports"],"sources":["../../../src/widgets/forms/fieldParams.ts"],"sourcesContent":["import * as ns from '../../ns'\nimport { commentStyle, formHeadingStyle, formGroupStyle } from '../../style'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: string, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n uriPrefix?: string, // e.g. 'mailto:', will be removed when displaying value to user. Overrides dt.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and uriPrefix.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n uriPrefix: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n uriPrefix: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: commentStyle\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: formHeadingStyle\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA4E,IAAAE,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,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EAKAJ,EAAE,CAAC6B,EAAE,CAAC,SAAS,CAAC,CAACC,GAAG,EAAG;EACtBS,OAAO,EAAE,GAAG;EACZN,KAAK,EAAEO;AACT,CAAC,OAAAZ,gBAAA,aAAAxB,YAAA,EACAJ,EAAE,CAAC6B,EAAE,CAAC,SAAS,CAAC,CAACC,GAAG,EAAG;EACtBS,OAAO,EAAE,IAAI;EACbN,KAAK,EAAEQ;AACT,CAAC,GAAArC,YAAA,CACF;AAAAsC,OAAA,CAAAf,WAAA,GAAAA,WAAA"}
@@ -81,6 +81,7 @@ var _error = require("./error");
81
81
  var _basic = require("./forms/basic");
82
82
  var _autocompleteField = require("./forms/autocomplete/autocompleteField");
83
83
  var style = _interopRequireWildcard(require("../style"));
84
+ var _styleConstants = _interopRequireDefault(require("../styleConstants"));
84
85
  var _iconBase = require("../iconBase");
85
86
  var log = _interopRequireWildcard(require("../log"));
86
87
  var ns = _interopRequireWildcard(require("../ns"));
@@ -93,10 +94,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
93
94
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
94
95
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
95
96
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
96
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /* F O R M S
97
- *
98
- * A Vanilla Dom implementation of the form language
99
- */ /* eslint-disable multiline-ternary */ /* global alert */ // Note default export
97
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
100
98
  var checkMarkCharacter = "\u2713";
101
99
  var cancelCharacter = "\u2715";
102
100
  var dashCharacter = '-';
@@ -769,7 +767,7 @@ _fieldFunction.field[ns.ui('MultiLineTextField').uri] = function (dom, container
769
767
  box.style.display = 'flex';
770
768
  box.style.flexDirection = 'row';
771
769
  var left = box.appendChild(dom.createElement('div'));
772
- left.style.width = style.formFieldNameBoxWidth;
770
+ left.style.width = _styleConstants["default"].formFieldNameBoxWidth;
773
771
  var right = box.appendChild(dom.createElement('div'));
774
772
  left.appendChild((0, _basic.fieldLabel)(dom, property, form));
775
773
  dataDoc = (0, _basic.fieldStore)(subject, property, dataDoc);
@@ -1196,7 +1194,7 @@ function promptForNew(dom, kb, subject, predicate, theClass, form, dataDoc, call
1196
1194
  }
1197
1195
 
1198
1196
  log.debug('form is ' + form);
1199
- box.setAttribute('style', "border: 0.05em solid ".concat(style.formBorderColor, "; color: ").concat(style.formBorderColor)); // @@color?
1197
+ box.setAttribute('style', "border: 0.05em solid ".concat(_styleConstants["default"].formBorderColor, "; color: ").concat(_styleConstants["default"].formBorderColor)); // @@color?
1200
1198
  box.innerHTML = '<h3>New ' + utils.label(theClass) + '</h3>';
1201
1199
  var formFunction = (0, _fieldFunction.fieldFunction)(dom, form);
1202
1200
  var object = newThing(dataDoc);
@@ -1257,12 +1255,12 @@ function makeDescription(dom, kb, subject, predicate, dataDoc, callbackFunction)
1257
1255
  submit.disabled = true;
1258
1256
  submit.setAttribute('style', 'visibility: hidden; float: right;'); // Keep UI clean
1259
1257
  field.disabled = true;
1260
- field.style.color = style.textInputColorPending; // setAttribute('style', style + 'color: gray;') // pending
1258
+ field.style.color = _styleConstants["default"].textInputColorPending;
1261
1259
  var ds = kb.statementsMatching(subject, predicate, null, dataDoc);
1262
1260
  var is = $rdf.st(subject, predicate, field.value, dataDoc);
1263
1261
  kb.updater.update(ds, is, function (uri, ok, body) {
1264
1262
  if (ok) {
1265
- field.style.color = style.textInputColor;
1263
+ field.style.color = _styleConstants["default"].textInputColor;
1266
1264
  field.disabled = false;
1267
1265
  } else {
1268
1266
  group.appendChild((0, _error.errorMessageBlock)(dom, 'Error (while saving change to ' + dataDoc.uri + '): ' + body));
@@ -1291,7 +1289,7 @@ function makeDescription(dom, kb, subject, predicate, dataDoc, callbackFunction)
1291
1289
  field.addEventListener('change', saveChange, true);
1292
1290
  } else {
1293
1291
  field.disabled = true; // @@ change color too
1294
- field.style.backgroundColor = style.textInputBackgroundColorUneditable;
1292
+ field.style.backgroundColor = _styleConstants["default"].textInputBackgroundColorUneditable;
1295
1293
  }
1296
1294
  return group;
1297
1295
  }
@@ -1416,7 +1414,7 @@ function makeSelectForClassifierOptions(dom, kb, subject, predicate, possible, o
1416
1414
  });
1417
1415
  };
1418
1416
  var select = dom.createElement('select');
1419
- select.setAttribute('style', style.formSelectSTyle);
1417
+ select.setAttribute('style', style.formSelectStyle);
1420
1418
  if (options.multiple) select.setAttribute('multiple', 'true');
1421
1419
  select.currentURI = null;
1422
1420
  select.refresh = function () {
@@ -1559,7 +1557,7 @@ function makeSelectForOptions(dom, kb, subject, predicate, possible, options, da
1559
1557
  });
1560
1558
  };
1561
1559
  var select = dom.createElement('select');
1562
- select.setAttribute('style', style.formSelectSTyle);
1560
+ select.setAttribute('style', style.formSelectStyle);
1563
1561
  select.currentURI = null;
1564
1562
  select.refresh = function () {
1565
1563
  actual = getActual(); // refresh
@@ -1845,7 +1843,7 @@ function makeSelectForChoice(dom, container, kb, subject, predicate, inputPossib
1845
1843
  select.refresh();
1846
1844
  };
1847
1845
  var select = dom.createElement('select');
1848
- select.setAttribute('style', style.formSelectSTyle);
1846
+ select.setAttribute('style', style.formSelectStyle);
1849
1847
  select.setAttribute('id', 'formSelect');
1850
1848
  select.currentURI = null;
1851
1849
  for (var uri in optionsFromClassUIfrom) {