Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TMP] Rest reference demos #2503

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95,647 changes: 95,647 additions & 0 deletions api.yaml

Large diffs are not rendered by default.

95,640 changes: 95,640 additions & 0 deletions docs/api/rest_api/rest_api_2/build/api.yaml

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions docs/api/rest_api/rest_api_2/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"files": {
"main.css": "/static/css/main.1c746339.css",
"main.js": "/static/js/main.74149ae4.js",
"static/js/453.ed3810f9.chunk.js": "/static/js/453.ed3810f9.chunk.js",
"static/media/logo.svg": "/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg",
"index.html": "/index.html",
"main.1c746339.css.map": "/static/css/main.1c746339.css.map",
"main.74149ae4.js.map": "/static/js/main.74149ae4.js.map",
"453.ed3810f9.chunk.js.map": "/static/js/453.ed3810f9.chunk.js.map"
},
"entrypoints": [
"static/css/main.1c746339.css",
"static/js/main.74149ae4.js"
]
}
1,942 changes: 1,942 additions & 0 deletions docs/api/rest_api/rest_api_2/build/css/base.css

Large diffs are not rendered by default.

Binary file added docs/api/rest_api/rest_api_2/build/favicon.ico
Binary file not shown.
172 changes: 172 additions & 0 deletions docs/api/rest_api/rest_api_2/build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<title>REST API Reference 2</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>

<body>
</body>

</html>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PHP REST Reference</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="icon" href="images/favicon.png"/>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>


<script>
window.addEventListener('keyup', (event) => {
if (event.key === '/') {
event.stopImmediatePropagation();
}
});
</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="blue-grey" data-md-color-accent="deep-orange">
<div class="popover popover--copied">Copied!</div>

<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">

<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="">

<a href="../php_api/"
title="PHP API Reference"
aria-label="PHP API Reference"
class="md-header__button md-logo"
>
<img src="../../../php_api/php_api_reference/images/ibexa-dxp-logo.png">
</a>
<div class="md-header__switcher push">
<div class="md-flex__ellipsis md-header__title switcher docs-switcher" data-md-component="title">
<div class="switcher__selected-item" tab-index="-1">
<div class="switcher__label" title="Developer Documentation">Developer Documentation</div>
</div>
<div class="switcher__list">
<dl>
<strong>
<dd>
<a href="/" title="Developer Documentation">Developer Documentation</a>
</dd>
</strong>
<dd>
<a href="/projects/userguide" title="User Documentation">User Documentation</a>
</dd>
<dd>
<a href="/projects/connect" title="Connect Documentation">Connect Documentation</a>
</dd>
</dl>
</div>
</div>
</div>
<div class="md-header__switcher">
<div class="md-flex__ellipsis md-header__title switcher version-switcher" data-md-component="title">
<div class="rst-other-versions switcher__list"></div>
</div>
</div>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner phpdocumentor-search" role="search" data-search-form>
<form class="md-search__form" name="search" >
<span class="algolia-autocomplete algolia-autocomplete-left">
<input
type="search"
id="search_input"
class="md-search__input phpdocumentor-field phpdocumentor-search__field"
name="query"
aria-label="Search"
placeholder="Search"
autocapitalize="off"
autocorrect="off"
autocomplete="off"
spellcheck="false"
data-md-component="search-query"
data-md-state="active"
required
>
<label class="md-search__icon md-icon" for="__search">
<img src="images/search.svg" alt="search">
</label>
<span
class="ds-dropdown-menu ds-with-1 phpdocumentor-search-results phpdocumentor-search-results--hidden"
role="listbox"
data-search-results
>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
<div class="ds-dataset-1">
<ul class="ds-suggestions phpdocumentor-search-results__entries">
</ul>
</div>
</span>
</span>
</form>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/ibexa/documentation-developer/tree/master/docs/api/php_api" title="" class="source-github">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><!--! Font Awesome Free 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"></path></svg>
</div>
View on GitHub
</a>
</div>
</nav>
</header>

<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="main_nav">
<div class="main_nav_content">
<div class="site-header" id="site-name">
<a href=".">PHP REST Reference</a>
<span class="pill">latest</span>
</div>

<div id="redoc-container"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
<script>
Redoc.init("https://gist.githubusercontent.com/mnocon/0094456f313ea2943b3b852bf76d9a95/raw/3423f2d97bba77e5080179cb9e2994c98d8dec9f/api_no_logo.yaml",
{
expandResponses: "200,400",
sidebar: {
width: 20
},
rightPanel: {
width: "10%"
}
}, document.getElementById("redoc-container"), (function (e) {
// document.querySelector('[title]').setAttribute("style", "background-color: red")
})
)</script>

</div>
</main>
</div>
</body>
</html>
173 changes: 173 additions & 0 deletions docs/api/rest_api/rest_api_2/build/js/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
// Search module for phpDocumentor
//
// This module is a wrapper around fuse.js that will use a given index and attach itself to a
// search form and to a search results pane identified by the following data attributes:
//
// 1. data-search-form
// 2. data-search-results
//
// The data-search-form is expected to have a single input element of type 'search' that will trigger searching for
// a series of results, were the data-search-results pane is expected to have a direct UL child that will be populated
// with rendered results.
//
// The search has various stages, upon loading this stage the data-search-form receives the CSS class
// 'phpdocumentor-search--enabled'; this indicates that JS is allowed and indices are being loaded. It is recommended
// to hide the form by default and show it when it receives this class to achieve progressive enhancement for this
// feature.
//
// After loading this module, it is expected to load a search index asynchronously, for example:
//
// <script defer src="js/searchIndex.js"></script>
//
// In this script the generated index should attach itself to the search module using the `appendIndex` function. By
// doing it like this the page will continue loading, unhindered by the loading of the search.
//
// After the page has fully loaded, and all these deferred indexes loaded, the initialization of the search module will
// be called and the form will receive the class 'phpdocumentor-search--active', indicating search is ready. At this
// point, the input field will also have it's 'disabled' attribute removed.
var Search = (function () {
var fuse;
var index = [];
var options = {
shouldSort: true,
threshold: 0.6,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [
"fqsen",
"name",
"summary",
"url"
]
};

// Credit David Walsh (https://davidwalsh.name/javascript-debounce-function)
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;

return function executedFunction() {
var context = this;
var args = arguments;

var later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};

var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
}

function close() {
// Start scroll prevention: https://css-tricks.com/prevent-page-scrolling-when-a-modal-is-open/
const scrollY = document.body.style.top;
document.body.style.position = '';
document.body.style.top = '';
window.scrollTo(0, parseInt(scrollY || '0') * -1);
// End scroll prevention

var form = document.querySelector('[data-search-form]');
var searchResults = document.querySelector('[data-search-results]');

form.classList.toggle('phpdocumentor-search--has-results', false);
searchResults.classList.add('phpdocumentor-search-results--hidden');
var searchField = document.querySelector('[data-search-form] input[type="search"]');
searchField.blur();
}

function search(event) {
// Start scroll prevention: https://css-tricks.com/prevent-page-scrolling-when-a-modal-is-open/
document.body.style.position = 'fixed';
document.body.style.top = `-${window.scrollY}px`;
// End scroll prevention

// prevent enter's from autosubmitting
event.stopPropagation();

var form = document.querySelector('[data-search-form]');
var searchResults = document.querySelector('[data-search-results]');
var searchResultEntries = document.querySelector('[data-search-results] .phpdocumentor-search-results__entries');

searchResultEntries.innerHTML = '';

if (!event.target.value) {
close();
return;
}

form.classList.toggle('phpdocumentor-search--has-results', true);
searchResults.classList.remove('phpdocumentor-search-results--hidden');
var results = fuse.search(event.target.value, {limit: 25});

results.forEach(function (result) {
var entry = document.createElement("li");
entry.classList.add("phpdocumentor-search-results__entry");
entry.innerHTML += '<h3><a href="' + document.baseURI + result.url + '">' + result.name + "</a></h3>\n";
entry.innerHTML += '<small>' + result.fqsen + "</small>\n";
entry.innerHTML += '<div class="phpdocumentor-summary">' + result.summary + '</div>';
searchResultEntries.appendChild(entry)
});
}

function appendIndex(added) {
index = index.concat(added);

// re-initialize search engine when appending an index after initialisation
if (typeof fuse !== 'undefined') {
fuse = new Fuse(index, options);
}
}

function init() {
fuse = new Fuse(index, options);

var form = document.querySelector('[data-search-form]');
var searchField = document.querySelector('[data-search-form] input[type="search"]');

var closeButton = document.querySelector('.phpdocumentor-search-results__close');
closeButton.addEventListener('click', function() { close() }.bind(this));

var searchResults = document.querySelector('[data-search-results]');
searchResults.addEventListener('click', function() { close() }.bind(this));

form.classList.add('phpdocumentor-search--active');

searchField.setAttribute('placeholder', 'Search (Press "/" to focus)');
searchField.removeAttribute('disabled');
searchField.addEventListener('keyup', debounce(search, 300));

window.addEventListener('keyup', function (event) {
if (event.key === '/') {
searchField.focus();
}
if (event.code === 'Escape') {
close();
}
}.bind(this));
}

return {
appendIndex,
init
}
})();

window.addEventListener('DOMContentLoaded', function () {
var form = document.querySelector('[data-search-form]');

// When JS is supported; show search box. Must be before including the search for it to take effect immediately
form.classList.add('phpdocumentor-search--enabled');
});

window.addEventListener('load', function () {
Search.init();
});
Binary file added docs/api/rest_api/rest_api_2/build/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/api/rest_api/rest_api_2/build/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions docs/api/rest_api/rest_api_2/build/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions docs/api/rest_api/rest_api_2/build/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading