openseadragon 1.0.15 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4aac7d093e88b64486949bdbff2cd0a7a3242dbff6c7256909d8391ac3845e4
4
- data.tar.gz: ec7ccd99a5d1611070e26d6e1521738068ff81e742832d72e0d25f2ab8462460
3
+ metadata.gz: ecac1d153b7c74a7151471aa8f469028a861302cf8506bc79d5a7a4872e675e4
4
+ data.tar.gz: ff5730c2c34c764f75f4c254f3a2f6cd2f0ccafeffce9cebc3c03d5ff7215bf8
5
5
  SHA512:
6
- metadata.gz: 7e7b34cf47a15292a567c807ed7ca2f09bf6d50b11c40713e2ddf2fc3a7856a45acf3202fafd2b9d0c8e19a28bf7fc3a1d66e334067f7834dff43650a54d3c6c
7
- data.tar.gz: 7a49c4fb48cc9501ea0e5ef2f0fdbfdbe1956344571d21ff0b9d0b1412ec5e9663c3cfe41ca0a2c141bbb62e4bbbf030bea5be7353ae07d686bb32e6d53f2ea8
6
+ metadata.gz: 36e7d7e92f695a59ae3af455ea3bee39cc8446695c8170ad24841b5f8239876c94670645e87ad0e8d445125dec714553d101ed8c46eda49b552ede4bf1ca868d
7
+ data.tar.gz: 68b69ddb11c2bd2a098ca18f632b34a07fbe80565a0e0c9a93eed6e197aeba6c7335309758451dc824dfa5d0a126afbefc615b60d60e81a276a97dce41949144
@@ -71,4 +71,4 @@ import OpenSeadragon from 'openseadragon';
71
71
  addEventListener('load', () => initOpenSeadragon());
72
72
  }
73
73
  })();
74
- //# sourceMappingURL=index.esm.js.map
74
+ //# sourceMappingURL=openseadragon-rails.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openseadragon-rails.esm.js","sources":["../../../javascript/openseadragon-rails/dom.js","../../../javascript/openseadragon-rails/rails.js"],"sourcesContent":["import OpenSeadragon from 'openseadragon'\n\n(function() {\n let __osd_counter = 0;\n\n function generateOsdId() {\n __osd_counter++;\n return \"Openseadragon\" + __osd_counter;\n }\n\n function openseadragon() {\n this.forEach(function(picture) {\n // Ensure the element is an HTMLElement\n if (!(picture instanceof HTMLElement)) return;\n\n picture.classList.add('openseadragon-viewer');\n\n // Set ID if it doesn't exist\n if (!picture.id) {\n picture.id = generateOsdId();\n }\n\n // Retrieve openseadragon data attribute as JSON\n const collectionOptions = picture.dataset.openseadragon\n ? JSON.parse(picture.dataset.openseadragon)\n : {};\n\n // Find all <source> elements with media=\"openseadragon\"\n const sources = Array.from(picture.querySelectorAll('source[media=\"openseadragon\"]'));\n\n const tileSources = sources.map(source => {\n const osdData = source.dataset.openseadragon;\n return osdData ? JSON.parse(osdData) : source.getAttribute('src');\n });\n\n // Preserve height of the picture\n const height = window.getComputedStyle(picture).height;\n picture.style.height = height;\n\n // Initialize OpenSeadragon\n picture.osdViewer = OpenSeadragon({\n id: picture.id,\n ...collectionOptions,\n tileSources: tileSources\n });\n });\n\n return this;\n }\n\n // Attach the function to NodeList and HTMLElement prototypes for convenience\n NodeList.prototype.openseadragon = openseadragon;\n HTMLCollection.prototype.openseadragon = openseadragon;\n\n // For a single HTMLElement\n HTMLElement.prototype.openseadragon = function() {\n return openseadragon.call([this]);\n };\n\n})();\n","import 'openseadragon-rails/dom'\n\n(function() {\n function initOpenSeadragon() {\n document.querySelectorAll('picture[data-openseadragon]:not(:has(.openseadragon-container))').openseadragon();\n }\n\n if (typeof Turbo !== 'undefined') {\n addEventListener(\"turbo:load\", () => initOpenSeadragon())\n addEventListener(\"turbo:frame-load\", () => initOpenSeadragon())\n } else {\n addEventListener('load', () => initOpenSeadragon())\n }\n})();\n"],"names":[],"mappings":";;AAEA,CAAC,WAAW;AACZ,EAAE,IAAI,aAAa,GAAG,CAAC;;AAEvB,EAAE,SAAS,aAAa,GAAG;AAC3B,IAAI,aAAa,EAAE;AACnB,IAAI,OAAO,eAAe,GAAG,aAAa;AAC1C;;AAEA,EAAE,SAAS,aAAa,GAAG;AAC3B,IAAI,IAAI,CAAC,OAA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Aa,GAAG,aAAa;;AAExD;AACA,EAAE,WAAW,CAAC,SAAS,CAAC,aAAa,GAAG,WAAW;AACnD,IAAI,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACrC,GAAG;;AAEH,CAAC,GAAG;;ACzDJ,CAAC,WAAW;AACZ,EAAE,SAAS,iBAAiB,GAAG;AAC/B,IAAI,QAAQ,CAAC,gBAAgB,CAAC,iEAAiE,CAAC,CAAC,aAAa,EAAE;AAChH;;AAEA,EAAE,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;AACpC,IAAI,gBAAgB,CAAC,YAAY,EAAE,MAAM,iBAAiB,EAAE;AAC5D,IAAI,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,iBAAiB,EAAE;AAClE,GAAG,MAAM;AACT,IAAI,gBAAgB,CAAC,MAAM,EAAE,MAAM,iBAAiB,EAAE;AACtD;AACA,CAAC,GAAG"}
@@ -77,4 +77,4 @@
77
77
  })();
78
78
 
79
79
  }));
80
- //# sourceMappingURL=index.js.map
80
+ //# sourceMappingURL=openseadragon-rails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openseadragon-rails.js","sources":["../../../javascript/openseadragon-rails/dom.js","../../../javascript/openseadragon-rails/rails.js"],"sourcesContent":["import OpenSeadragon from 'openseadragon'\n\n(function() {\n let __osd_counter = 0;\n\n function generateOsdId() {\n __osd_counter++;\n return \"Openseadragon\" + __osd_counter;\n }\n\n function openseadragon() {\n this.forEach(function(picture) {\n // Ensure the element is an HTMLElement\n if (!(picture instanceof HTMLElement)) return;\n\n picture.classList.add('openseadragon-viewer');\n\n // Set ID if it doesn't exist\n if (!picture.id) {\n picture.id = generateOsdId();\n }\n\n // Retrieve openseadragon data attribute as JSON\n const collectionOptions = picture.dataset.openseadragon\n ? JSON.parse(picture.dataset.openseadragon)\n : {};\n\n // Find all <source> elements with media=\"openseadragon\"\n const sources = Array.from(picture.querySelectorAll('source[media=\"openseadragon\"]'));\n\n const tileSources = sources.map(source => {\n const osdData = source.dataset.openseadragon;\n return osdData ? JSON.parse(osdData) : source.getAttribute('src');\n });\n\n // Preserve height of the picture\n const height = window.getComputedStyle(picture).height;\n picture.style.height = height;\n\n // Initialize OpenSeadragon\n picture.osdViewer = OpenSeadragon({\n id: picture.id,\n ...collectionOptions,\n tileSources: tileSources\n });\n });\n\n return this;\n }\n\n // Attach the function to NodeList and HTMLElement prototypes for convenience\n NodeList.prototype.openseadragon = openseadragon;\n HTMLCollection.prototype.openseadragon = openseadragon;\n\n // For a single HTMLElement\n HTMLElement.prototype.openseadragon = function() {\n return openseadragon.call([this]);\n };\n\n})();\n","import 'openseadragon-rails/dom'\n\n(function() {\n function initOpenSeadragon() {\n document.querySelectorAll('picture[data-openseadragon]:not(:has(.openseadragon-container))').openseadragon();\n }\n\n if (typeof Turbo !== 'undefined') {\n addEventListener(\"turbo:load\", () => initOpenSeadragon())\n addEventListener(\"turbo:frame-load\", () => initOpenSeadragon())\n } else {\n addEventListener('load', () => initOpenSeadragon())\n }\n})();\n"],"names":[],"mappings":";;;;;;EAEA,CAAC,WAAW;EACZ,EAAE,IAAI,aAAa,GAAG,CAAC;;EAEvB,EAAE,SAAS,aAAa,GAAG;EAC3B,IAAI,aAAa,EAAE;EACnB,IAAI,OAAO,eAAe,GAAG,aAAa;EAC1C;;EAEA,EAAE,SAAS,aAAa,GAAG;EAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,OAAO,EAAE;EACnC;EACA,MAAM,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;;EAE7C,MAAM,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC;;EAEnD;EACA,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE;EACvB,QAAQ,OAAO,CAAC,EAAE,GAAG,aAAa,EAAE;EACpC;;EAEA;EACA,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;EAChD,UAAU,IAAI,CAAC,K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,EAAE;EACpC,IAAI,gBAAgB,CAAC,YAAY,EAAE,MAAM,iBAAiB,EAAE;EAC5D,IAAI,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,iBAAiB,EAAE;EAClE,GAAG,MAAM;EACT,IAAI,gBAAgB,CAAC,MAAM,EAAE,MAAM,iBAAiB,EAAE;EACtD;EACA,CAAC,GAAG;;;;;;"}
@@ -1,4 +1,4 @@
1
- import './dom'
1
+ import 'openseadragon-rails/dom'
2
2
 
3
3
  (function() {
4
4
  function initOpenSeadragon() {
@@ -1,3 +1,3 @@
1
1
  module Openseadragon
2
- VERSION = '1.0.15'
2
+ VERSION = '1.0.16'
3
3
  end
data/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "openseadragon-rails",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Openseadragon support for Rails apps",
5
5
  "exports": {
6
6
  ".": "./app/javascript/openseadragon-rails/index.js",
7
7
  "./*": "./app/javascript/openseadragon-rails/*.js"
8
8
  },
9
- "main": "app/assets/javascripts/openseadragon-rails/index.js",
9
+ "main": "app/assets/javascripts/openseadragon-rails/openseadragon-rails.js",
10
10
  "module": "app/javascript/openseadragon-rails/index.js",
11
11
  "files": [
12
12
  "app/javascript/openseadragon-rails/*.js",
data/rollup.config.js CHANGED
@@ -4,7 +4,7 @@ import commonjs from '@rollup/plugin-commonjs';
4
4
  const BUNDLE = process.env.BUNDLE === 'true'
5
5
  const ESM = process.env.ESM === 'true'
6
6
 
7
- const fileDest = `index${ESM ? '.esm' : ''}`
7
+ const fileDest = `openseadragon-rails${ESM ? '.esm' : ''}`
8
8
  const external = [
9
9
  'openseadragon',
10
10
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openseadragon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-01-10 00:00:00.000000000 Z
13
+ date: 2025-01-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -127,10 +127,10 @@ files:
127
127
  - LICENSE
128
128
  - README.md
129
129
  - Rakefile
130
- - app/assets/javascripts/openseadragon-rails/index.esm.js
131
- - app/assets/javascripts/openseadragon-rails/index.esm.js.map
132
- - app/assets/javascripts/openseadragon-rails/index.js
133
- - app/assets/javascripts/openseadragon-rails/index.js.map
130
+ - app/assets/javascripts/openseadragon-rails/openseadragon-rails.esm.js
131
+ - app/assets/javascripts/openseadragon-rails/openseadragon-rails.esm.js.map
132
+ - app/assets/javascripts/openseadragon-rails/openseadragon-rails.js
133
+ - app/assets/javascripts/openseadragon-rails/openseadragon-rails.js.map
134
134
  - app/assets/stylesheets/openseadragon/openseadragon.css
135
135
  - app/helpers/openseadragon/openseadragon_helper.rb
136
136
  - app/javascript/openseadragon-rails/dom.js
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../javascript/openseadragon-rails/dom.js","../../../javascript/openseadragon-rails/rails.js"],"sourcesContent":["import OpenSeadragon from 'openseadragon'\n\n(function() {\n let __osd_counter = 0;\n\n function generateOsdId() {\n __osd_counter++;\n return \"Openseadragon\" + __osd_counter;\n }\n\n function openseadragon() {\n this.forEach(function(picture) {\n // Ensure the element is an HTMLElement\n if (!(picture instanceof HTMLElement)) return;\n\n picture.classList.add('openseadragon-viewer');\n\n // Set ID if it doesn't exist\n if (!picture.id) {\n picture.id = generateOsdId();\n }\n\n // Retrieve openseadragon data attribute as JSON\n const collectionOptions = picture.dataset.openseadragon\n ? JSON.parse(picture.dataset.openseadragon)\n : {};\n\n // Find all <source> elements with media=\"openseadragon\"\n const sources = Array.from(picture.querySelectorAll('source[media=\"openseadragon\"]'));\n\n const tileSources = sources.map(source => {\n const osdData = source.dataset.openseadragon;\n return osdData ? JSON.parse(osdData) : source.getAttribute('src');\n });\n\n // Preserve height of the picture\n const height = window.getComputedStyle(picture).height;\n picture.style.height = height;\n\n // Initialize OpenSeadragon\n picture.osdViewer = OpenSeadragon({\n id: picture.id,\n ...collectionOptions,\n tileSources: tileSources\n });\n });\n\n return this;\n }\n\n // Attach the function to NodeList and HTMLElement prototypes for convenience\n NodeList.prototype.openseadragon = openseadragon;\n HTMLCollection.prototype.openseadragon = openseadragon;\n\n // For a single HTMLElement\n HTMLElement.prototype.openseadragon = function() {\n return openseadragon.call([this]);\n };\n\n})();\n","import './dom'\n\n(function() {\n function initOpenSeadragon() {\n document.querySelectorAll('picture[data-openseadragon]:not(:has(.openseadragon-container))').openseadragon();\n }\n\n if (typeof Turbo !== 'undefined') {\n addEventListener(\"turbo:load\", () => initOpenSeadragon())\n addEventListener(\"turbo:frame-load\", () => initOpenSeadragon())\n } else {\n addEventListener('load', () => initOpenSeadragon())\n }\n})();\n"],"names":[],"mappings":";;AAEA,CAAC,WAAW;AACZ,EAAE,IAAI,aAAa,GAAG,CAAC;;AAEvB,EAAE,SAAS,aAAa,GAAG;AAC3B,IAAI,aAAa,EAAE;AACnB,IAAI,OAAO,eAAe,GAAG,aAAa;AAC1C;;AAEA,EAAE,SAAS,aAAa,GAAG;AAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,OAAO,EAAE;AACnC;AACA,MAAM,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;;AAE7C,MAAM,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC;;AAEnD;AACA,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE;AACvB,QAAQ,OAAO,CAAC,EAAE,GAAG,aAAa,EAAE;AACpC;;AAEA;AACA,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;AAChD,UAAU,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa;AACl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,MAAM,iBAAiB,EAAE;AAC5D,IAAI,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,iBAAiB,EAAE;AAClE,GAAG,MAAM;AACT,IAAI,gBAAgB,CAAC,MAAM,EAAE,MAAM,iBAAiB,EAAE;AACtD;AACA,CAAC,GAAG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../javascript/openseadragon-rails/dom.js","../../../javascript/openseadragon-rails/rails.js"],"sourcesContent":["import OpenSeadragon from 'openseadragon'\n\n(function() {\n let __osd_counter = 0;\n\n function generateOsdId() {\n __osd_counter++;\n return \"Openseadragon\" + __osd_counter;\n }\n\n function openseadragon() {\n this.forEach(function(picture) {\n // Ensure the element is an HTMLElement\n if (!(picture instanceof HTMLElement)) return;\n\n picture.classList.add('openseadragon-viewer');\n\n // Set ID if it doesn't exist\n if (!picture.id) {\n picture.id = generateOsdId();\n }\n\n // Retrieve openseadragon data attribute as JSON\n const collectionOptions = picture.dataset.openseadragon\n ? JSON.parse(picture.dataset.openseadragon)\n : {};\n\n // Find all <source> elements with media=\"openseadragon\"\n const sources = Array.from(picture.querySelectorAll('source[media=\"openseadragon\"]'));\n\n const tileSources = sources.map(source => {\n const osdData = source.dataset.openseadragon;\n return osdData ? JSON.parse(osdData) : source.getAttribute('src');\n });\n\n // Preserve height of the picture\n const height = window.getComputedStyle(picture).height;\n picture.style.height = height;\n\n // Initialize OpenSeadragon\n picture.osdViewer = OpenSeadragon({\n id: picture.id,\n ...collectionOptions,\n tileSources: tileSources\n });\n });\n\n return this;\n }\n\n // Attach the function to NodeList and HTMLElement prototypes for convenience\n NodeList.prototype.openseadragon = openseadragon;\n HTMLCollection.prototype.openseadragon = openseadragon;\n\n // For a single HTMLElement\n HTMLElement.prototype.openseadragon = function() {\n return openseadragon.call([this]);\n };\n\n})();\n","import './dom'\n\n(function() {\n function initOpenSeadragon() {\n document.querySelectorAll('picture[data-openseadragon]:not(:has(.openseadragon-container))').openseadragon();\n }\n\n if (typeof Turbo !== 'undefined') {\n addEventListener(\"turbo:load\", () => initOpenSeadragon())\n addEventListener(\"turbo:frame-load\", () => initOpenSeadragon())\n } else {\n addEventListener('load', () => initOpenSeadragon())\n }\n})();\n"],"names":[],"mappings":";;;;;;EAEA,CAAC,WAAW;EACZ,EAAE,IAAI,aAAa,GAAG,CAAC;;EAEvB,EAAE,SAAS,aAAa,GAAG;EAC3B,IAAI,aAAa,EAAE;EACnB,IAAI,OAAO,eAAe,GAAG,aAAa;EAC1C;;EAEA,EAAE,SAAS,aAAa,GAAG;EAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,OAAO,EAAE;EACnC;EACA,MAAM,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;;EAE7C,MAAM,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC;;EAEnD;EACA,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE;EACvB,QAAQ,OAAO,CAAC,EAAE,GAAG,aAAa,EAAE;EACpC;;EAEA;EACA,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;EAChD,UAAU,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa;EAClD,UAAU,EAAE;;EAEZ;EACA,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,+BAA+B,CAAC,CAAC;;EAE3F,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI;EAChD,QAAQ,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa;EACpD,QAAQ,OAAO,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC;EACzE,OAAO,CAAC;;EAER;EACA,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM;EAC5D,M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