@naivemap/map-gl-layer-adaptor 0.1.0 → 0.2.0-alpha.1

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
+ (function(r,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.MapGLLayerAdaptor={}))})(this,function(r){"use strict";function n(t){if(Array.isArray(t))return t;const a=t?.defaultProjectionData?.mainMatrix;if(a)return a;throw new Error("Unable to resolve projection matrix from render arguments.")}function p(t){const e=t?.painter;!e||e.terrain||(e.currentStencilSource=void 0,e._tileClippingMaskIDs={})}function d(t,e){let a;return{id:e.id,type:"custom",renderingMode:e.renderingMode??"2d",onAdd(i,o){a=i,t.onAdd(i,o)},onRemove(i,o){t.onRemove(i,o),a=void 0},render(i,o){if(!a)throw new Error("Layer adaptor render invoked before onAdd.");t.render({map:a,gl:i,matrix:(e.resolveMatrix??n)(o),rawArgs:o,prepareStencilMask:e.prepareStencilMask?()=>e.prepareStencilMask(a):void 0})}}}const c=d,u=d;r.clearTileClippingMask=p,r.createCustomLayerAdaptor=d,r.createMapLibreLayerAdaptor=c,r.createMapboxLayerAdaptor=u,r.resolveLayerMatrix=n,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@naivemap/map-gl-layer-adaptor",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-alpha.1",
4
4
  "description": "Framework-agnostic adaptor primitives for MapLibre GL JS and Mapbox GL JS custom layers.",
5
- "main": "./dist/index.cjs",
6
- "module": "./dist/index.js",
5
+ "main": "./dist/index.umd.js",
6
+ "module": "./dist/index.es.js",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
11
+ "import": "./dist/index.es.js",
12
+ "require": "./dist/index.umd.js"
13
13
  }
14
14
  },
15
15
  "files": [
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r){if(Array.isArray(r))return r;const a=r?.defaultProjectionData?.mainMatrix;if(a)return a;throw new Error("Unable to resolve projection matrix from render arguments.")}function d(r){const e=r?.painter;!e||e.terrain||(e.currentStencilSource=void 0,e._tileClippingMaskIDs={})}function i(r,e){let a;return{id:e.id,type:"custom",renderingMode:e.renderingMode??"2d",onAdd(t,n){a=t,r.onAdd(t,n)},onRemove(t,n){r.onRemove(t,n),a=void 0},render(t,n){if(!a)throw new Error("Layer adaptor render invoked before onAdd.");r.render({map:a,gl:t,matrix:(e.resolveMatrix??o)(n),rawArgs:n,prepareStencilMask:e.prepareStencilMask?()=>e.prepareStencilMask(a):void 0})}}}const c=i,p=i;exports.clearTileClippingMask=d;exports.createCustomLayerAdaptor=i;exports.createMapLibreLayerAdaptor=c;exports.createMapboxLayerAdaptor=p;exports.resolveLayerMatrix=o;
File without changes