lincd
Version:
LINCD is a JavaScript library for building user interfaces with linked data (also known as 'structured data', or RDF)
165 lines • 6.95 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.nextTick = void 0;
exports.initModularApp = initModularApp;
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
//import everything from each file that we want to be bundled in the stand-alone dist/lincd.js file
const Module = __importStar(require("./utils/Module"));
const models = __importStar(require("./models"));
const LinkedErrorLogging = __importStar(require("./utils/LinkedErrorLogging"));
const LinkedFileStorage = __importStar(require("./utils/LinkedFileStorage"));
const LinkedStorage = __importStar(require("./utils/LinkedStorage"));
const EventEmitter = __importStar(require("./events/EventEmitter"));
const NodeURIMappings = __importStar(require("./collections/NodeURIMappings"));
const CoreSet = __importStar(require("./collections/CoreSet"));
const CoreMap = __importStar(require("./collections/CoreMap"));
const SearchMap = __importStar(require("./collections/SearchMap"));
const PropertySet = __importStar(require("./collections/NodeValuesSet"));
const NodeMap = __importStar(require("./collections/NodeMap"));
const NodeSet = __importStar(require("./collections/NodeSet"));
const QuadArray = __importStar(require("./collections/QuadArray"));
const QuadMap = __importStar(require("./collections/QuadMap"));
const QuadSet = __importStar(require("./collections/QuadSet"));
const Shape = __importStar(require("./shapes/Shape"));
const SHACLShapes = __importStar(require("./shapes/SHACL"));
const ShapeSet = __importStar(require("./collections/ShapeSet"));
const Prefix = __importStar(require("./utils/Prefix"));
const Debug = __importStar(require("./utils/Debug"));
const URI = __importStar(require("./utils/URI"));
const Find = __importStar(require("./utils/Find"));
const Order = __importStar(require("./utils/Order"));
const NQuads = __importStar(require("./utils/NQuads"));
const LinkedComponentClass = __importStar(require("./utils/LinkedComponentClass"));
const ForwardReasoning = __importStar(require("./utils/ForwardReasoning"));
const NameSpace = __importStar(require("./utils/NameSpace"));
const Hooks = __importStar(require("./utils/Hooks"));
const ShapeClass = __importStar(require("./utils/ShapeClass"));
const ShapeDecorators = __importStar(require("./utils/ShapeDecorators"));
const ClassNames = __importStar(require("./utils/ClassNames"));
const List = __importStar(require("./shapes/List"));
const IGraphObject = __importStar(require("./interfaces/IGraphObject"));
const IGraphObjectSet = __importStar(require("./interfaces/IGraphObjectSet"));
const ICoreIterable = __importStar(require("./interfaces/ICoreIterable"));
const IFileStore = __importStar(require("./interfaces/IFileStore"));
const IQuadStore = __importStar(require("./interfaces/IQuadStore"));
const Component = __importStar(require("./interfaces/Component"));
const rdf = __importStar(require("./ontologies/rdf"));
const rdfs = __importStar(require("./ontologies/rdfs"));
const xsd = __importStar(require("./ontologies/xsd"));
const shacl = __importStar(require("./ontologies/shacl"));
const DataFactory = __importStar(require("./Datafactory"));
const react_1 = __importDefault(require("react"));
exports.nextTick = require('next-tick');
function initModularApp() {
//we don't want people to import {NamedNode} from 'lincd' for example
//because this does not work well with tree shaking
//therefor we do not export all the classes here from the index directly
//instead we make all components of LINCD available through the global tree for modular apps
let publicFiles = {
DataFactory,
Node,
EventEmitter,
NodeURIMappings,
CoreSet,
CoreMap,
SearchMap,
PropertySet,
NodeMap,
NodeSet,
QuadArray,
QuadMap,
QuadSet,
models,
LinkedErrorLogging,
LinkedFileStorage,
LinkedStorage,
Shape,
ShapeSet,
Debug,
NameSpace,
List,
ClassNames,
URI,
Hooks,
ShapeClass,
ForwardReasoning,
Find,
Order,
Prefix,
NQuads,
Boolean,
ShapeDecorators,
Module,
IGraphObject,
IGraphObjectSet,
ICoreIterable,
IFileStore,
IQuadStore,
Component,
LinkedComponentClass,
SHACLShapes,
rdf,
rdfs,
xsd,
shacl,
};
//register the library in the global tree and make all classes available directly from it
var lincdExport = {};
for (let fileKey in publicFiles) {
let exportedClasses = publicFiles[fileKey];
for (let className in exportedClasses) {
lincdExport[className] = exportedClasses[className];
}
}
//add all the exports to the global LINCD object
if (typeof window !== 'undefined') {
Object.assign(window['lincd'], lincdExport);
}
else if (typeof global !== 'undefined') {
Object.assign(global['lincd'], lincdExport);
}
//modular apps will expect React to be available as a global variable
//therefor when enabling modular apps, lincd makes its own React version available through window
window['React'] = react_1.default;
}
//# sourceMappingURL=index.js.map