pict 1.0.310 → 1.0.312
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.
- package/dist/pict.compatible.js +18 -3
- package/dist/pict.compatible.js.map +1 -1
- package/dist/pict.compatible.min.js +1 -1
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +18 -3
- package/dist/pict.js.map +1 -1
- package/dist/pict.min.js +1 -1
- package/dist/pict.min.js.map +1 -1
- package/package.json +1 -1
- package/source/Pict-Content-Assignment.js +19 -1
- package/source/Pict.js +20 -0
- package/test/Pict_contentassignment_tests.js +10 -0
- package/test/Pict_view_tests.js +28 -0
- package/types/source/Pict-Content-Assignment.d.ts +8 -1
- package/types/source/Pict-Content-Assignment.d.ts.map +1 -1
- package/types/source/Pict.d.ts +12 -0
- package/types/source/Pict.d.ts.map +1 -1
package/dist/pict.compatible.js
CHANGED
|
@@ -5249,7 +5249,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
5249
5249
|
// presumably different callback function.
|
|
5250
5250
|
// This makes sure that own properties are retained, so that
|
|
5251
5251
|
// decorations and such are not lost along the way.
|
|
5252
|
-
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],190:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],191:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.
|
|
5252
|
+
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],190:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],191:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.311","description":"Pict browser library.","main":"source/Pict.js","scripts":{"start":"node source/Pict.js","test":"npx mocha -u tdd -R spec","tests":"npx mocha -u tdd --exit -R spec --grep","coverage":"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-image:local","docker-dev-run":"docker run -it -d --name pict-dev -p 37447:8080 -p 19506:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-image:local","docker-dev-shell":"docker exec -it pict-dev /bin/bash","lint":"eslint source/**/*.js test/**/*.js","types":"tsc -p ."},"types":"types/source/Pict.d.ts","mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"git+https://stevenvelozo@github.com/stevenvelozo/pict.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/pict/issues"},"homepage":"https://github.com/stevenvelozo/pict#readme","devDependencies":{"@eslint/js":"^9.27.0","@types/jquery":"^3.5.32","@types/sinon":"^17.0.4","eslint":"^9.27.0","globals":"^16.2.0","quackage":"^1.0.42","sinon":"^20.0.0","typescript":"^5.8.3"},"dependencies":{"cachetrax":"^1.0.4","fable":"^3.1.23","pict-application":"^1.0.29","pict-provider":"^1.0.6","pict-template":"^1.0.13","pict-view":"^1.0.63"}};},{}],192:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
|
|
5253
5253
|
/* global Pict, _Pict: writeable *//**
|
|
5254
5254
|
* Simple function to load a pict Application
|
|
5255
5255
|
*
|
|
@@ -5430,11 +5430,16 @@ var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.j
|
|
|
5430
5430
|
* Check if an element has a class.
|
|
5431
5431
|
*
|
|
5432
5432
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
5433
|
-
* @param {string} pClass - The class to
|
|
5433
|
+
* @param {string} pClass - The class to toggle.
|
|
5434
5434
|
*
|
|
5435
5435
|
* @return {boolean} - Whether the element has the class. If multiple elements are matched, returns true if any have the class.
|
|
5436
5436
|
*/},{key:"hasClass",value:function hasClass(pAddress,pClass){if(this.customReadClassFunction){return this.customReadClassFunction(pAddress,pClass);}if(this.hasJquery){//FIXME: this is silly, but it makes the type system happy - it picks a different overload for each case
|
|
5437
|
-
var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));return false;}}
|
|
5437
|
+
var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));return false;}}/**
|
|
5438
|
+
* Toggle a class on or off an element
|
|
5439
|
+
*
|
|
5440
|
+
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
5441
|
+
* @param {string} pClass - The class to check for.
|
|
5442
|
+
*/},{key:"toggleClass",value:function toggleClass(pAddress,pClass){if(this.hasClass(pAddress,pClass)){this.removeClass(pAddress,pClass);}else{this.addClass(pAddress,pClass);}}}]);}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":68}],196:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase21){function PictDataProvider(pFable,pOptions,pServiceHash){var _this77;_classCallCheck2(this,PictDataProvider);_this77=_callSuper(this,PictDataProvider,[pFable,pOptions,pServiceHash]);/** @type {import('fable') & import('./Pict')} */_this77.fable;_this77.serviceType='PictDataProvider';return _this77;}/**
|
|
5438
5443
|
* @param {string} pAddress - The address of the data to retrieve
|
|
5439
5444
|
* @param {object} [pData] - (optional) The record to provide to the address resolver
|
|
5440
5445
|
*/_inherits(PictDataProvider,_libFableServiceBase21);return _createClass2(PictDataProvider,[{key:"getDataByAddress",value:function getDataByAddress(pAddress,pData){var tmpData=typeof pData==='undefined'?{}:pData;var tmpAddressSpace={Fable:this.fable,Pict:this.fable,AppData:this.fable.AppData,Bundle:this.fable.Bundle,Record:tmpData};return this.fable.manifest.getValueByHash(tmpAddressSpace,pAddress);}}]);}(libFableServiceBase);module.exports=PictDataProvider;},{"fable":68}],197:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase22){function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this78$fable$RestCli;var _this78;_classCallCheck2(this,PictMeadowEntityProvider);_this78=_callSuper(this,PictMeadowEntityProvider,[pFable,pOptions,pServiceHash]);/** @type {any} */_this78.options;/** @type {import('./Pict') & { settings: any } & { newAnticipate: any }} */_this78.fable;/** @type {any} */_this78.log;_this78.serviceType='PictMeadowProvider';if(_this78.fable.settings.PictDefaultURLPrefix){_this78.options.urlPrefix=_this78.fable.settings.PictDefaultURLPrefix;}else if(!_this78.options.urlPrefix){_this78.options.urlPrefix='/1.0/';}if(!_this78.options.downloadBatchSize){if(typeof _this78.fable.settings.PictDefaultDownloadBatchSize==='number'){_this78.options.downloadBatchSize=_this78.fable.settings.PictDefaultDownloadBatchSize;}else{_this78.options.downloadBatchSize=100;}}//@ts-ignore - FIXME - remove once we have fable types
|
|
@@ -5666,6 +5671,16 @@ var tmpManifestKey=tmpManifestKeys[i];this.instantiateServiceProvider("Manifest"
|
|
|
5666
5671
|
*/},{key:"addView",value:function addView(pViewHash,pOptions,pViewPrototype){var tmpOptions=_typeof(pOptions)=="object"?pOptions:{};var tmpViewHash=typeof pViewHash=="string"?pViewHash:this.fable.getUUID();// This is here to change how the value is managed by webpack
|
|
5667
5672
|
var tmpViewPrototype=pViewPrototype;if(this.LogControlFlow){if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addView [".concat(tmpViewHash,"]:"),{Options:tmpOptions});}else{this.log.info("PICT-ControlFlow addView [".concat(tmpViewHash,"]"));}}if(tmpViewPrototype){// If the prototype has a default_configuration, it will be merged with options.
|
|
5668
5673
|
var tmpDefaultViewConfiguration=tmpViewPrototype["default_configuration"];if(tmpDefaultViewConfiguration){tmpOptions=this.fable.Utility.extend({},JSON.parse(JSON.stringify(tmpDefaultViewConfiguration)),tmpOptions);}return this.instantiateServiceProviderFromPrototype("PictView",tmpOptions,tmpViewHash,tmpViewPrototype);}else{return this.instantiateServiceProvider("PictView",tmpOptions,tmpViewHash);}}/**
|
|
5674
|
+
* Add a view unless one already exists, then return that one.
|
|
5675
|
+
* Just passing an options will construct one for us.
|
|
5676
|
+
* Passing a hash will set the hash.
|
|
5677
|
+
* Passing a prototype will use that!
|
|
5678
|
+
*
|
|
5679
|
+
* @param {String} pViewHash - The hash of the view.
|
|
5680
|
+
* @param {Object<String, any>} [pOptions] - The options for the view.
|
|
5681
|
+
* @param {any} [pViewPrototype] - The prototype for the view.
|
|
5682
|
+
* @return {any} The view instance.
|
|
5683
|
+
*/},{key:"addViewSingleton",value:function addViewSingleton(pViewHash,pOptions,pViewPrototype){if(pViewHash in this.views){return this.views[pViewHash];}return this.addView(pViewHash,pOptions,pViewPrototype);}/**
|
|
5669
5684
|
* Add a provider unless one already exists, then return that one.
|
|
5670
5685
|
*
|
|
5671
5686
|
* Just passing an options will construct one for us.
|