tjek / tjek-js-sdk Goto Github PK
View Code? Open in Web Editor NEWTjek JavaScript SDK for the browser and Node.js.
Tjek JavaScript SDK for the browser and Node.js.
For example, http://localhost:5000/dist/integrations/elgiganten/index.html gets rewritten to http://localhost:5000/dist/integrations/elgiganten.
formData
field is ignored when passed to the request
function
The current hardcoded SGN.CoreUIKit.singleChoicePopover
usage is not flexible enough. At time of writing REMA wanted a custom picker or simply defaulting to the first hotspot in the list, but we support neither right now.
seems this endpoint not providing X-Token
headers will break any further requests from the SDK that require auth https://github.com/shopgun/vampire_squid/blob/develop/routes.php#L136
short repro https://codesandbox.io/s/l517x9p7wq
try signing in, fetching lists a couple of times, checking a list's modified and then fetching lists again
Right now, images show a standard browser outline/border whilst the images load or init lazyload. We should make the images invisible until they have loaded.
Currently a catalog 404 will result in a less than useful Uncaught TypeError: Cannot read property 'pageflip' of undefined
We need this for offline support.
Show at the bottom center of the screen and autohide when there hasn't been any scroll.
Also consider renaming addTranslations
to update
to imply you can update existing translations.
It currently takes too much work to figure out which pages(not spreads) we are coming from/to.
README needs to be much clearer about this
The Vizsla error tracking gets spammed with this warning because of how the incito viewer currently handles loading/playing/pausing videos during scrolling.
Where is the api documentation?
I only seem to get a progress event when it's done uploading a file.
For the EventsKit we should look into keepalive=true
to get our events shipped on unload.
https://fetch.spec.whatwg.org/#request-keepalive-flag
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch
see keepalive flag description.
Prior to 2.2.11 SGN.CoreKit.request would assume any provided request body
should be JSON encoded and sent off with JSON mime headers: https://github.com/shopgun/shopgun-js-sdk/blob/dad037561f49c3c18b140b764a0d5e66bef825aa/lib/coffeescript/kits/core/request.coffee#L10
As of 2.2.11 this is no longer the case and currently it is necessary to write out those things:
const session = await SGN.CoreKit.request({
url: "/v2/sessions",
method: "PUT",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
email,
password,
}),
});
I'm going to restore this behavior as well as reintroduce the "json" option.
This lets anyone using PagedPublicationKit utilize the data fetched for their own use.
We need this for offline support.
beforeNavigation
doesn't do this - only afterNavigation
triggers twice with the same data.
Parent issue:
So as to support integrators consuming version ranges such as:
Currently event-tracker-pool
is set on localStorage
on all sites with shopgun-sdk
included in any way, regardless of whether an EventTracker is even active on the page. The code also runs serverside on any node server that require('shopgun-sdk');
(but doesn't do anything except cost a few cycles to throw a couple of caught errors).
Repro:
viewer.bind("beforeNavigation", ({ verso }) => viewer.navigateTo(verso.newPosition));
Parent issue: https://github.com/tjek/TjekTeams/issues/628
Prerequisite issue: https://github.com/tjek/vizsla/issues/348
A new endpoint /v2/catalogs/[id]/page_decorations
with the output shape [{page_number, title, website_link}]
is to be used to fetch links to turn certain pages into per-page links.
When rendered inside a container that's offset from the top, the popover is incorrectly positioned.
This happens when you navigate with a transition duration > 0 and go forward.
With the current setup importing shopgun-sdk
in a webpack setup everything blows up, we should provide a CommonJS build where we don't rely on things like coffee-script/register
. That kind of monkey patching globals is really not something you want a dependency doing.
Getting this error after updating to 2.1.4:
bundle.js:28802 Uncaught Error: Cannot find module "child_process"
at webpackMissingModule (bundle.js:28802)
at bundle.js:28802
at Object. (bundle.js:28805)
at Object. (bundle.js:40988)
at webpack_require (bootstrap 938a2135e317cbe97e17:19)
at Object. (es7.string.pad-end.js:8)
at webpack_require (bootstrap 938a2135e317cbe97e17:19)
at Object.defineProperty.value (es7.string.match-all.js:6)
at webpack_require (bootstrap 938a2135e317cbe97e17:19)
at Object. (es7.reflect.get-own-metadata-keys.js:4)
This is useful for things like aggressively preloading offer data before the hotspot is actually clicked.
Let the .request
methods of the graphkit and the corekit return a Promise
when not passed a callback function in the last argument, so as to provide an API like so:
SGN.CoreKit.request({ url: '/v2/catalogs' })
.then(function(data){/* handle data */})
.catch(function(error){/* handle error */})
Check the environment for support and throw an error if support is not present. Said error should suggest using the callback style or adding a Promise
polyfill.
This is hacked in in react-lab like
let versoPosition;
if (this.props.position === 'end') {
versoPosition = viewer._core.verso.pageSpreads.length - 1;
} else {
// PagedPublicationKit should expose this sorta thing
versoPosition = +viewer._core.verso.pageIds[`page${this.props.position}`].id
.replace('double-', '')
.replace('single-', '');
}
viewer.navigateTo(versoPosition);
This should serve to clean up our messy entry split+build config and move any feature detection complexity to where the feature is used or to the package consumer(for example, them trying to initialize a *-publicationkit on a node environment fails for obvious reasons, but importing the package does not and they should be able to use our isomorphic features just fine(corekit, graphkit)).
We can do this once these PRs are merged and next versions published:
tjek/verso-browser#4
tjek/incito-browser#2
We don't seem to be able to change the order of our catalogs when getting them from the following endpoint:
https://api.etilbudsavis.dk/v2/catalogs?dealer_id=XXXXX&order_by=-publication_date&r_locale=en_US
Whether we put "order_by=publication_date" or "order_by=-publication_date", it stays the same. Also, sometimes the order changes without us changing the order_by parameter.
Do you have any insight as to why we are experiencing this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.